:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f3f6fb;
  line-height: 1.5;
  --blue: #243f9d;
  --border: #dce3ee;
  --muted: #657086;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
a { color: var(--blue); }
p { margin-top: .65rem; }
h1, h2 { margin: 0; line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }

.container {
  width: min(980px, calc(100% - 28px));
  margin: auto;
  padding: 30px 0 50px;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: 0 7px 22px rgba(26, 39, 70, .05);
}

.hero { padding: 25px 28px; }
.hero > p { margin: .28rem 0 0; color: #566178; }
.kicker, .eyebrow {
  margin: 0 0 7px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #43517a;
}

form { display: grid; gap: 11px; }
label { display: block; margin-bottom: 5px; font-weight: 750; }
label span, small { color: var(--muted); font-weight: 500; }
input, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #b9c4d4;
  border-radius: 10px;
  background: #fff;
  color: inherit;
}
textarea { min-height: 104px; resize: vertical; }
textarea.compact { min-height: 72px; }
input:focus, textarea:focus {
  outline: 3px solid rgba(42, 76, 183, .14);
  border-color: #2a4cb7;
}

.advanced-settings {
  border: 1px solid #d7dfeb;
  border-radius: 10px;
  background: #fafbfe;
}
.advanced-settings summary {
  cursor: pointer;
  padding: 11px 13px;
  font-weight: 750;
  list-style-position: inside;
}
.advanced-settings summary span {
  margin-left: 7px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 500;
}
.advanced-content { padding: 2px 13px 13px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }

.source-options { margin: 2px 0 0; padding: 0; border: 0; }
.source-options legend { margin-bottom: 1px; font-weight: 800; }
.field-help { margin: 0 0 7px; color: var(--muted); font-size: .87rem; }
.source-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 6px;
  padding: 9px 11px;
  border: 1px solid #d7dfeb;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.source-option:has(input:checked) { border-color: #2a4cb7; background: #f5f7ff; }
.source-option input { width: auto; margin: 4px 0 0; accent-color: var(--blue); }
.source-option span, .source-option strong, .source-option small { display: block; }
.source-option small { margin-top: 1px; line-height: 1.35; }

button { border-radius: 10px; padding: 11px 15px; cursor: pointer; font-weight: 800; }
.primary-button { border: 0; background: var(--blue); color: #fff; padding: 13px 17px; }
.secondary-button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--blue); background: #fff; color: var(--blue);
  text-decoration: none; white-space: nowrap;
}
.secondary-button:hover { background: #f4f6ff; }
button:disabled { opacity: .65; cursor: progress; }
.status { min-height: 16px; margin: 3px 0; color: #566178; }
.status.error { color: #a12626; }
.status.success { color: #17653a; }
.hidden { display: none; }
.answers { display: grid; gap: 14px; }
.answer { margin-bottom: 0; }
.answer-heading { margin-bottom: 12px; }
.response {
  margin: 0; padding: 16px;
  background: #f6f8ff; border-left: 4px solid var(--blue);
  border-radius: 5px 10px 10px 5px; font-size: 1.02rem; font-style: normal;
}
.translation-actions { margin-top: 5px; text-align: right; }
.translate-button {
  border: 0; background: transparent; color: #6f7889; padding: 2px 4px;
  font-size: .72rem; font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px;
}
.translate-button:hover, .translate-button:focus-visible { color: var(--blue); outline: none; background: #f4f6fa; }
.thai-translation {
  margin-top: 7px; padding: 11px 13px; border-left: 2px solid #cbd4e5;
  background: #fafbfe; border-radius: 4px 9px 9px 4px; line-height: 1.7; white-space: pre-wrap;
}
.thai-translation.translation-error { color: #a12626; border-left-color: #d7a4a4; }

.view-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.view-part { background: #f4f6fa; padding: 12px; border-radius: 10px; }
.view-part strong { display: block; margin-bottom: 3px; }
.view-part p { margin: 0; }
.coach-details { margin-top: .9rem; border-top: 1px solid var(--border); padding-top: .7rem; }
.coach-details summary { cursor: pointer; font-weight: 700; }
.coach-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .7rem; }
.alternative-actions {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid #e1e7f0;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.alternative-actions p { margin: 0; color: #566178; font-size: .88rem; max-width: 620px; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.context-heading { margin-bottom: 12px; }
.context-heading h2 { margin-top: 2px; }
.context-sections { display: grid; gap: 12px; }
.subsection-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.subsection-heading > strong, .subsection-heading > div > strong { font-size: 1rem; }
.as-of { white-space: nowrap; background: rgba(255,255,255,.72); border-radius: 999px; padding: 5px 9px; color: #566178; font-size: .8rem; font-weight: 700; }
.internal-guidance, .market-brief { border: 1px solid #dfe5ee; background: #fff; border-radius: 11px; overflow: hidden; }
.guidance-heading { background: #fff5d9; border-bottom-color: #ead8a6; }
.guidance-heading > div { display: grid; gap: 1px; }
.guidance-heading span { color: #6f654f; font-size: .82rem; font-weight: 500; }
.guidance-body { padding: 0 15px 12px; }
.guidance-download { white-space: nowrap; font-size: .82rem; font-weight: 700; text-decoration: none; border: 1px solid rgba(36,63,157,.25); border-radius: 999px; padding: 5px 9px; background: rgba(255,255,255,.8); }
.guidance-item { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 11px; padding-top: 11px; }
.guidance-item + .guidance-item { margin-top: 8px; border-top: 1px solid #e8ecf2; }
.guidance-pair { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.guidance-item strong { color: var(--blue); }
.guidance-copy p, .guidance-fallback { margin: 0; line-height: 1.55; }
.guidance-copy p + p { margin-top: 7px; }
.guidance-copy .movement-meaning { color: #4f596b; font-size: .86rem; font-weight: 650; }
.movement-badge { display: inline-flex; padding: 3px 8px; border: 1px solid #d7deea; border-radius: 999px; background: #fff; color: #44506a; font-size: .7rem; font-weight: 750; }
.movement-up { color: #246948; } .movement-down { color: #8b4141; } .movement-flat { color: #596478; } .movement-mixed, .movement-unclear { color: #765f2f; }
.market-brief-heading { background: #edf3ff; border-bottom-color: #d4dff1; }
.market-brief-body { padding: 14px; }
.context-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.context-part { border: 1px solid #e1e7f0; background: #fff; border-radius: 10px; padding: 12px; }
.context-part strong { display: block; color: var(--blue); }
.context-part p { margin: 5px 0 0; }
.source-strip { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin-top: 12px; color: #7b8495; font-size: .74rem; }
.source-chips { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.source-chip { padding: 1px 4px; color: #66728a; font-size: .7rem; font-weight: 650; text-decoration: none; border-bottom: 1px dotted #aab3c3; }
.caution { margin: 13px 0 0; color: var(--muted); font-size: .8rem; }
.key-assumptions { border: 1px solid #dfe3ea; background: #f4f5f7; border-radius: 10px; padding: 11px 13px; color: #596273; }
.key-assumptions strong { display: block; margin-bottom: 3px; color: #444d5e; font-size: .86rem; }
.key-assumptions p { margin: 0; font-size: .86rem; }
.source-unavailable { border-color: #ecd69b; background: #fffaf0; }
.source-unavailable h2 { font-size: 1.12rem; }

footer { color: var(--muted); font-size: .82rem; padding: 14px 4px; }
code { background: #eef2f8; border-radius: 5px; padding: .1em .35em; }

/* FX report manager */
.admin-container { width: min(900px, calc(100% - 32px)); }
.admin-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.admin-hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.admin-hero p:last-child { max-width: 650px; color: #566178; }
.helper-text { color: var(--muted); }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.admin-status-card { display: grid; gap: 5px; border: 1px solid #d9e1ec; background: #f7f9fc; border-radius: 12px; padding: 16px; color: #4f5d73; }
.admin-status-card strong { color: #172033; }
.admin-status-card.success { border-color: #a7d7ba; background: #f0faf4; }
.admin-status-card.warning { border-color: #e9cf8f; background: #fff9e9; }
.admin-status-card.error { border-color: #e5b0b0; background: #fff3f3; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.upload-form { margin-top: 16px; }
.file-drop { display: grid; gap: 4px; border: 2px dashed #b8c5d8; border-radius: 14px; padding: 22px; background: #f8faff; cursor: pointer; }
.file-drop:hover { border-color: #647bb7; }
.file-drop-title { font-weight: 800; }
.file-drop-detail { color: var(--muted); font-weight: 500; }
.file-drop input { margin-top: 10px; padding: 10px; }
.admin-notes ol { margin-bottom: 0; padding-left: 1.4rem; }
.admin-link { margin-top: .5rem; text-align: center; font-size: .9rem; }

@media (max-width: 760px) {
  .form-row, .context-grid, .view-grid, .coach-content { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .as-of { display: inline-block; margin-top: 8px; }
  .guidance-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .guidance-item { grid-template-columns: 1fr; gap: 6px; }
  .guidance-pair { flex-direction: row; align-items: center; justify-content: space-between; }
  .alternative-actions { align-items: stretch; flex-direction: column; }
  .secondary-button { width: 100%; white-space: normal; }
}
@media (max-width: 650px) {
  .container { width: min(100% - 18px, 980px); padding-top: 18px; }
  .panel { padding: 17px; }
  .hero { padding: 20px; }
  .advanced-settings summary span { display: block; margin: 2px 0 0 21px; }
  .admin-hero { display: block; }
  .admin-hero .secondary-button { margin-top: 14px; }
  .token-row { grid-template-columns: 1fr; }
  .button-row > * { width: 100%; }
}

.translation-actions {
  margin-top: 7px;
  text-align: right;
}

.translate-button {
  border: 0;
  background: transparent;
  color: #6f7889;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.translate-button:hover,
.translate-button:focus-visible {
  color: #243f9d;
  outline: none;
  background: #f4f6fa;
}

.translate-button:disabled {
  cursor: default;
  opacity: .72;
}

.thai-translation {
  margin-top: 8px;
  padding: 12px 14px;
  border-left: 2px solid #cbd4e5;
  background: #fafbfe;
  border-radius: 4px 9px 9px 4px;
  color: #30394b;
  font-size: .96rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.thai-translation.translation-error {
  color: #a12626;
  border-left-color: #d7a4a4;
}

/* FX report manager */
.admin-container { width: min(900px, calc(100% - 32px)); }
.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.admin-hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.admin-hero p:last-child { max-width: 650px; color: #566178; }
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #aebbd0;
  background: #fff;
  color: #243f9d;
  text-decoration: none;
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 800;
  white-space: nowrap;
}
.secondary-button:hover { background: #f4f6fb; }
.helper-text { color: #657086; }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.admin-status-card {
  display: grid;
  gap: 5px;
  border: 1px solid #d9e1ec;
  background: #f7f9fc;
  border-radius: 12px;
  padding: 16px;
  color: #4f5d73;
}
.admin-status-card strong { color: #172033; }
.admin-status-card.success { border-color: #a7d7ba; background: #f0faf4; }
.admin-status-card.success strong, .status.success { color: #17653a; }
.admin-status-card.warning { border-color: #e9cf8f; background: #fff9e9; }
.admin-status-card.warning strong { color: #835d00; }
.admin-status-card.error { border-color: #e5b0b0; background: #fff3f3; }
.admin-status-card.error strong, .status.error { color: #a12626; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.upload-form { margin-top: 16px; }
.file-drop {
  display: grid;
  gap: 4px;
  border: 2px dashed #b8c5d8;
  border-radius: 14px;
  padding: 22px;
  background: #f8faff;
  cursor: pointer;
}
.file-drop:hover { border-color: #647bb7; }
.file-drop-title { color: #172033; font-weight: 800; }
.file-drop-detail { color: #657086; font-weight: 500; }
.file-drop input { margin-top: 10px; padding: 10px; background: #fff; }
.admin-notes ol { margin-bottom: 0; padding-left: 1.4rem; }
.admin-link { margin-top: .5rem; text-align: center; font-size: .9rem; }
.admin-link a { color: #566178; font-weight: 700; }
code { background: #eef2f8; border-radius: 5px; padding: .1em .35em; }

@media (max-width: 650px) {
  .admin-hero { display: block; }
  .admin-hero .secondary-button { margin-top: 16px; }
  .token-row { grid-template-columns: 1fr; }
  .button-row > * { width: 100%; }
}

.guidance-heading > div {
  display: grid;
  gap: 2px;
}

.guidance-download {
  white-space: nowrap;
  font-size: .84rem;
  font-weight: 700;
  color: #243f9d;
  text-decoration: none;
  border: 1px solid rgba(36, 63, 157, .25);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .7);
}

.guidance-download:hover { text-decoration: underline; }

.alternative-actions {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #e1e7f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.alternative-actions p {
  margin: 0;
  color: #566178;
  font-size: .9rem;
  max-width: 620px;
}

.secondary-button {
  border: 1px solid #243f9d;
  background: white;
  color: #243f9d;
  padding: 10px 14px;
  border-radius: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.secondary-button:hover { background: #f4f6ff; }

@media (max-width: 700px) {
  .alternative-actions { align-items: stretch; flex-direction: column; }
  .secondary-button { width: 100%; white-space: normal; }
}

.guidance-pair {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.movement-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(36, 63, 157, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  color: #44506a;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.2;
}

.movement-up { border-color: rgba(47, 122, 86, .28); color: #246948; }
.movement-down { border-color: rgba(166, 79, 79, .28); color: #8b4141; }
.movement-flat { border-color: rgba(92, 104, 127, .24); color: #596478; }
.movement-mixed,
.movement-unclear { border-color: rgba(157, 120, 46, .26); color: #765f2f; }

.guidance-copy p {
  margin: 0;
  line-height: 1.58;
}

.guidance-copy p + p {
  margin-top: 8px;
}

.guidance-copy .movement-meaning {
  color: #5f5746;
  font-size: .88rem;
  font-weight: 650;
}

@media (max-width: 640px) {
  .guidance-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .guidance-pair {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
