/* ========================================================================
   ACTIVATION TABS + STRUCTURE CARDS
   ======================================================================== */
.act-tabs {
  display: flex; gap: 0.25rem; margin-bottom: 1rem;
  border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.act-tab {
  padding: 0.6rem 1rem; border: none; background: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all 0.15s;
}
.act-tab:hover { color: var(--fg); }
.act-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.act-tab-count {
  display: inline-block; background: #e5e7eb; color: var(--muted);
  font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.4rem;
  border-radius: 999px; margin-left: 0.25rem; vertical-align: middle;
}
.act-tab.active .act-tab-count { background: var(--primary); color: #fff; }

/* Phase accordion */
.struct-phase { margin-bottom: 0.5rem; }
.struct-phase-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all 0.15s;
}
.struct-phase-header:hover { border-color: var(--primary); }
.struct-phase-info { display: flex; align-items: center; gap: 0.6rem; }
.struct-phase-num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.struct-phase-title { font-weight: 600; font-size: 0.9rem; }
.struct-phase-meta { }
.struct-phase-arrow { font-size: 1rem; color: var(--muted); transition: transform 0.2s; }
.struct-phase-items { padding: 0.25rem 0 0.5rem; }

/* Individual structure card */
.struct-card {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem;
  background: var(--card-bg); border: 1px solid #f0f0f0; border-radius: 8px;
  margin: 0.25rem 0; text-decoration: none; color: var(--fg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.struct-card:hover { border-color: var(--primary); box-shadow: 0 1px 4px rgba(37,99,235,.08); text-decoration: none; }
.struct-card.struct-activated { border-left: 3px solid var(--success); }
.struct-card-num {
  font-size: 0.7rem; font-weight: 700; color: var(--muted); min-width: 2rem; text-align: center;
}
.struct-card-body { flex: 1; min-width: 0; }
.struct-card-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.struct-card-fn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.struct-card-status { flex-shrink: 0; }
.struct-badge {
  width: 24px; height: 24px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700;
}
.struct-badge-done { background: var(--success); color: #fff; }
.struct-badge-wip { background: #fef9c3; color: var(--warning); border: 1px solid var(--warning); }

/* ========================================================================
   STRUCTURE PRACTICE PAGE
   ======================================================================== */
.struct-practice .struct-topbar {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem;
}
.struct-practice .back-link { font-size: 1.5rem; color: var(--muted); text-decoration: none; line-height: 1; }
.struct-practice .topbar-info { flex: 1; }
.struct-practice .topbar-title { font-weight: 600; font-size: 1rem; display: block; }
.struct-practice .topbar-progress { }

.struct-function { margin-bottom: 0.75rem; }
.struct-situation {
  margin-bottom: 0.75rem; border-left: 4px solid #f59e0b;
}
.struct-record { margin-bottom: 0.75rem; }
.struct-anti {
  margin-bottom: 0.75rem; border-left: 4px solid var(--danger); font-size: 0.85rem;
}
.struct-anti-content { white-space: pre-line; line-height: 1.7; }
.struct-examples { margin-bottom: 0.75rem; }
.struct-examples-list { padding-left: 0; list-style: none; font-size: 0.9rem; line-height: 1.7; }
.struct-examples-list li { margin-bottom: 0.2rem; }

/* Example rows: situation (context cue) is small + faint, phrase (target) is prominent */
.struct-ex-row { margin-bottom: 0.6rem; }
.struct-ex-situation {
  font-size: 0.75rem; color: var(--muted); font-style: italic;
  margin-bottom: 0.1rem; line-height: 1.3;
}
.struct-ex-phrase {
  font-size: 1rem; font-weight: 600; line-height: 1.4;
}

.struct-warning {
  background: #fee2e2; color: var(--danger); padding: 0.4rem 0.6rem;
  border-radius: 6px; margin-top: 0.35rem;
}

/* Vocabulary slots */
.struct-vocab {
  margin-bottom: 1rem; padding: 0.75rem; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 8px;
}
.struct-vocab-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.5rem;
}
.struct-vocab-row { margin-bottom: 0.35rem; font-size: 0.85rem; line-height: 1.5; }
.struct-vocab-cat { font-weight: 600; color: var(--fg); }
.struct-vocab-items { color: #64748b; }

.struct-nav {
  display: flex; justify-content: space-between; padding: 1rem 0;
}

/* Text input + record area on structure practice page */
.struct-input-area {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  padding: 0.5rem 0; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.struct-text-check {
  display: flex; gap: 0.5rem; align-items: center;
  opacity: 0.6; transition: opacity 0.15s;
}
.struct-text-check:focus-within { opacity: 1; }
.struct-text-input {
  flex: 1; padding: 0.6rem 0.75rem; border: 1px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 0.95rem;
}
.struct-text-input:focus { border-color: var(--primary); outline: none; }
.struct-check-btn {
  padding: 0.6rem 1rem; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; white-space: nowrap;
}
.struct-check-btn:hover { background: var(--primary-hover); }
.struct-check-btn:disabled { opacity: 0.5; cursor: wait; }
.struct-rec-area { display: flex; align-items: center; gap: 0.75rem; justify-content: center; margin-bottom: 0.75rem; }

/* ------------------------------------------------------------------------
   Structure-practice compact swap layout (input ↔ spinner ↔ result).
   Scoped to .struct-row inside .struct-input-area, so the deck-drill page
   (which still uses .struct-rec-area + .struct-text-check stacked) is
   untouched. Keeps the sticky bar at ~50px regardless of state.
   ------------------------------------------------------------------------ */
.struct-input-area > .struct-row {
  display: flex; align-items: center; gap: 1rem; min-height: 48px;
}
.struct-input-area > .struct-spinner-row {
  justify-content: center; color: var(--muted); font-style: italic;
}

/* Text input wraps the inline ↵ check button (absolute positioned). */
.struct-input-area > .struct-row .struct-text-wrap {
  position: relative; flex: 1 1 auto; min-width: 0;
  height: 48px;  /* explicit so the absolute-positioned ↵ has a known anchor */
  box-sizing: border-box;
}
.struct-input-area > .struct-row .struct-text-input {
  width: 100%;
  height: 48px;  /* explicit; iOS Safari needs -webkit-appearance:none for this to stick */
  box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
  padding: 0 3rem 0 0.8rem;  /* vertical centering via height + line-height */
  border: 1.5px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 1rem; line-height: 48px;
}
.struct-input-area > .struct-row .struct-text-input:focus {
  border-color: var(--primary); outline: none;
}
/* Inline ↵ check button — ghost style so it reads as part of the field's rim,
   not a competing primary action. Hidden until ≥ 2 words.
   Centered with top:0/bottom:0/margin:auto (more reliable than translateY in iOS). */
.struct-input-area > .struct-row .struct-check-btn {
  position: absolute; right: 6px;
  top: 0; bottom: 0; margin: auto 0;
  width: 36px; height: 36px; border-radius: 8px;
  -webkit-appearance: none; appearance: none;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--primary);
  border: none; padding: 0;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  align-items: center; justify-content: center;
  display: none;
  transition: background-color 0.15s;
}
.struct-input-area > .struct-row .struct-check-btn:hover,
.struct-input-area > .struct-row .struct-check-btn:active,
.struct-input-area > .struct-row .struct-check-btn:focus {
  background-color: rgba(37, 99, 235, 0.10) !important;
  outline: none;
}
.struct-input-area > .struct-row .struct-check-btn.visible { display: inline-flex; }
.struct-input-area > .struct-row .struct-check-btn:hover { background: var(--primary-hover); }
.struct-input-area > .struct-row .struct-check-btn:disabled { opacity: 0.5; cursor: wait; }

/* REC button on the right — compact mic-icon pill. The visual recipe is the
   reusable .rec-pill below; this scoped rule only owns layout/size in the row.
   No timer numbers — recording state is shown by .rec-pill.recording. */
.struct-input-area > .struct-row .struct-rec-btn {
  flex: 0 0 auto;
  width: 56px; height: 48px;
  box-sizing: border-box;
  -webkit-appearance: none; appearance: none;  /* iOS Safari ignores explicit height on <button> without this */
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── .rec-pill — reusable record button ──────────────────────────────────
   Stories-style outlined brand pill with a mic icon, narrower, NO numbers.
   Brand #ff4700 is the spec's reserved "recording" accent (see 00-v2-tokens).
   Recording = filled + gentle pulse; hover = a much lighter brand tint.
   Reuse anywhere a compact record affordance is needed (own-example input,
   shortlist phrase, etc.) by adding class="rec-pill" + the mic SVG. */
.rec-pill {
  border: 2px solid var(--primary);
  background: #fff;
  color: var(--primary);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.rec-pill .rec-mic-icon { width: 22px; height: 22px; display: block; }
.rec-pill:hover  { background: rgba(255, 71, 0, 0.06); }   /* much lighter hover */
.rec-pill:active { background: rgba(255, 71, 0, 0.10); }
.rec-pill.recording {
  background: var(--primary); border-color: var(--primary); color: #fff;
  animation: rec-pill-pulse 1.4s ease-in-out infinite;
}
@keyframes rec-pill-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 0, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 71, 0, 0); }
}

/* Result-row inline display — overrides the block layout from 04-anketa.css */
.struct-input-area > .struct-row .struct-result-score {
  flex: 0 0 auto; display: inline-block;
  font-size: 1rem; font-weight: 800;
  padding: 0.2rem 0.55rem; border-radius: 6px; line-height: 1.2;
  margin-top: 0;
}
.struct-input-area > .struct-row .struct-result-score.good { background: #d1fae5; color: var(--success); }
.struct-input-area > .struct-row .struct-result-score.ok   { background: #fef3c7; color: var(--warning); }
.struct-input-area > .struct-row .struct-result-score.low  { background: #fee2e2; color: var(--danger); }
.struct-input-area > .struct-row .struct-result-text {
  flex: 1 1 auto; min-width: 0; display: inline-block;
  font-size: 0.85rem; color: var(--fg); margin-top: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.struct-input-area > .struct-row .struct-result-feedback {
  flex: 0 0 auto; display: inline-block;
  font-size: 0.8rem; color: var(--muted); margin-top: 0;
  max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.struct-retry-btn {
  flex: 0 0 auto; width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--card-bg); cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.struct-retry-btn:hover { background: #f3f4f6; color: var(--fg); }

/* Quick actions bar on activation page */
.activation-quick-actions {
  display: flex; gap: 0.5rem; margin-bottom: 1rem;
}
.activation-quick-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.5rem 1rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--card-bg); color: var(--fg);
  font-size: 0.85rem; font-weight: 600; text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.activation-quick-btn:hover {
  border-color: var(--primary); background: #eff6ff; text-decoration: none;
}

/* Check-phrase page input */
.check-textarea {
  width: 100%; padding: 0.75rem; border: 1px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 1rem;
  resize: vertical; min-height: 80px;
}
.check-textarea:focus { border-color: var(--primary); outline: none; }

/* Mobile adjustments for structure cards */
@media (max-width: 500px) {
  .struct-card-fn { display: none; }
  .struct-card-title { font-size: 0.85rem; }
}

