:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17201a;
  background: #f5f7f2;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 50% 0, #e4f3df 0, transparent 34rem), #f5f7f2; }
button, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #dce2da; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 780; letter-spacing: -.02em; }
.brand img { border-radius: 10px; box-shadow: 0 6px 18px #366f4733; }
.nav-tools { display: flex; align-items: center; gap: 12px; }
.privacy-note { color: #69756d; font-size: 12px; }
.language-picker select, .control-card select, .language-row select { color: #344039; border: 1px solid #d9dfd7; background: #fff; border-radius: 10px; padding: 9px 12px; font-size: 12px; }

.hero { padding: 88px 0 48px; text-align: center; }
.eyebrow { color: #2f7549; font-size: 10px; line-height: 1.2; font-weight: 800; letter-spacing: .18em; }
.hero h1 { max-width: 860px; margin: 15px auto 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 7.4vw, 88px); font-weight: 500; line-height: .97; letter-spacing: -.055em; }
.hero > p:last-child { max-width: 650px; margin: 24px auto 0; color: #68736b; font-size: clamp(16px, 2vw, 19px); line-height: 1.7; }

.product-workspace { overflow: hidden; border: 1px solid #d7ded5; border-radius: 28px; background: #fff; box-shadow: 0 35px 90px #38523d1f, 0 4px 14px #2435270a; }
.workspace-header { min-height: 80px; padding: 17px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e3e8e1; background: #fcfdfb; }
.workspace-header > div { display: flex; align-items: center; gap: 12px; }
.window-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: #28643f; font-family: Georgia, serif; font-weight: 700; }
.workspace-header h2 { font-size: 15px; letter-spacing: -.02em; }
.workspace-header p { margin-top: 3px; color: #859087; font-size: 11px; }
.model-status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dfe5dd; border-radius: 999px; color: #68736b; font-size: 11px; background: #f8faf7; }
.model-status > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #92a097; }
.model-status.is-approved { color: #28643f; background: #eff8f1; border-color: #cae3d0; }
.model-status.is-approved > span:first-child { background: #4da96a; }

.tab-list { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 22px; border-bottom: 1px solid #e3e8e1; background: #fafbf9; }
.tab { position: relative; min-height: 83px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #879089; background: transparent; }
.tab::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.tab + .tab { border-left: 1px solid #e5e9e3; }
.tab-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #dce2da; border-radius: 10px; color: #59645c; background: #fff; font-family: Georgia, serif; font-size: 13px; font-weight: 700; }
.tab > span:last-child { display: grid; gap: 3px; text-align: left; }
.tab strong { color: #59645c; font-size: 13px; }
.tab small { font-size: 10px; }
.tab.is-active { color: #4d6957; }
.tab.is-active::after { background: #2e7248; }
.tab.is-active .tab-icon { color: #fff; background: #2e7248; border-color: #2e7248; box-shadow: 0 6px 16px #2e724826; }
.tab.is-active strong { color: #1e4f32; }

.scenario-panel { min-height: 610px; padding: 34px; background: #fff; animation: panel-in .25s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.panel-heading > div { display: flex; align-items: center; gap: 12px; }
.scenario-number { display: grid; place-items: center; width: 28px; height: 28px; color: #2f7549; border: 1px solid #cfe1d2; border-radius: 50%; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: #f0f8f1; }
.panel-heading h3 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 3.2vw, 36px); font-weight: 500; letter-spacing: -.035em; }
.panel-heading > p { max-width: 360px; color: #758078; font-size: 13px; line-height: 1.6; text-align: right; }

.chat-surface { max-width: 850px; margin: 0 auto; }
.chat-messages { display: grid; gap: 17px; min-height: 310px; padding: 26px; border: 1px solid #e1e6df; border-radius: 20px; background: #f9faf8; }
.message { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 11px; max-width: 78%; animation: message-in .28s ease-out; }
@keyframes message-in { from { opacity: 0; transform: translateY(6px); } }
.message.user { grid-template-columns: minmax(0, 1fr) 32px; justify-self: end; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #2d6d46; font-family: Georgia, serif; font-size: 11px; font-weight: 700; }
.message.user .avatar { grid-column: 2; color: #607066; background: #e7ede5; font-family: inherit; }
.message-bubble { padding: 13px 15px; border: 1px solid #dfe5dd; border-radius: 4px 15px 15px; color: #364139; background: #fff; font-size: 13px; line-height: 1.65; box-shadow: 0 3px 10px #2c3d3008; white-space: pre-line; }
.message.user .message-bubble { grid-column: 1; grid-row: 1; color: #f7fff9; background: #2d6d46; border-color: #2d6d46; border-radius: 15px 4px 15px 15px; }
.message.typing .message-bubble { display: flex; gap: 4px; padding: 17px; }
.message.typing i { width: 5px; height: 5px; border-radius: 50%; background: #7d8a80; animation: blink 1s infinite alternate; }
.message.typing i:nth-child(2) { animation-delay: .2s; }
.message.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { to { opacity: .25; transform: translateY(-2px); } }
.prompt-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.prompt-chip, .translation-samples button { padding: 8px 11px; color: #496052; border: 1px solid #d8e1d8; border-radius: 999px; background: #f8fbf7; font-size: 11px; }
.prompt-chip:hover, .translation-samples button:hover { color: #245c39; border-color: #b8d1bd; background: #f0f8f1; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-top: 15px; padding: 11px; border: 1px solid #d7ded5; border-radius: 16px; background: #fff; box-shadow: 0 8px 25px #233d2b0b; }
.composer textarea { min-height: 42px; max-height: 130px; resize: none; border: 0; outline: 0; padding: 10px; color: #243028; background: transparent; line-height: 1.5; }
.composer textarea::placeholder, .control-card textarea::placeholder, .translation-input-wrap textarea::placeholder { color: #a3aca5; }
.send-button { min-width: 90px; height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #fff; border: 1px solid #2d6d46; border-radius: 11px; background: #2d6d46; font-size: 12px; font-weight: 720; transition: color .16s ease, border-color .16s ease, background-color .16s ease; }
.send-button:disabled, .composer textarea:placeholder-shown + .send-button { color: #818b83; border-color: #d7ded7; background: #eef1ee; cursor: not-allowed; opacity: 1; }
.send-button[aria-busy="true"] { color: #566159; }
.send-icon.is-loading { width: 13px; height: 13px; border: 2px solid #bac3bc; border-top-color: #566159; border-radius: 50%; font-size: 0; animation: connect-spin .8s linear infinite; }

.writing-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 24px; }
.control-card, .document-card, .translation-card { border: 1px solid #dfe5dd; border-radius: 20px; background: #f9faf8; }
.control-card { display: grid; align-content: start; gap: 11px; padding: 22px; }
.control-card label, .control-card legend { color: #56635a; font-size: 11px; font-weight: 720; }
.control-card label:not(:first-child) { margin-top: 6px; }
.control-card textarea, .control-card select { width: 100%; border: 1px solid #d8dfd7; border-radius: 11px; color: #27342b; background-color: #fff; outline: 0; }
.control-card textarea { resize: vertical; padding: 12px; line-height: 1.55; }
.control-card select { min-height: 43px; }
.control-card fieldset { margin: 7px 0 0; padding: 0; border: 0; }
.tone-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 9px; }
.tone-option { padding: 9px; color: #69756d; border: 1px solid #d9dfd7; border-radius: 9px; background: #fff; font-size: 11px; }
.tone-option.is-selected { color: #215b37; border-color: #9fc6aa; background: #eef8f0; }
.primary-action { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; color: #fff; border-radius: 11px; background: #2d6d46; font-size: 12px; font-weight: 740; }
.control-card .primary-action { margin-top: 10px; }
.primary-action:disabled { opacity: .55; cursor: wait; }
.document-card { min-height: 435px; padding: 18px 30px 30px; background: #fff; box-shadow: inset 0 0 0 5px #f8faf7; }
.document-toolbar { min-height: 37px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e6eae4; }
.document-toolbar > span { color: #89928b; font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
.copy-button { padding: 6px 9px; color: #5f6b62; border: 1px solid #dfe5dd; border-radius: 8px; background: #fff; font-size: 10px; }
.article-output { max-width: 570px; margin: 28px auto 0; }
.article-output h4 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3.2vw, 39px); font-weight: 500; line-height: 1.08; letter-spacing: -.04em; }
.article-output .article-kicker { margin-bottom: 12px; color: #2f7549; font-size: 10px; font-weight: 780; letter-spacing: .13em; }
.article-output p { margin-top: 17px; color: #5f6b62; font-family: Georgia, "Times New Roman", serif; font-size: 14px; line-height: 1.85; }
.article-output .article-meta { margin-top: 15px; color: #98a19a; font-family: inherit; font-size: 10px; }

.translation-samples { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; color: #7b867e; font-size: 11px; }
.translation-card { overflow: hidden; background: #fff; }
.language-row { display: grid; grid-template-columns: 1fr 44px 1fr; align-items: center; border-bottom: 1px solid #e2e7e0; }
.language-row label { padding: 10px 18px; }
.language-row label:last-child { border-left: 1px solid #e2e7e0; }
.language-row select { width: 100%; border: 0; padding-left: 0; color: #3f4b43; background-color: transparent; font-weight: 700; }
.swap-button { width: 32px; height: 32px; display: grid; place-items: center; justify-self: center; color: #4e5c52; border: 1px solid #dce2da; border-radius: 50%; background: #fff; }
.translation-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 300px; }
.translation-input-wrap, .translation-output-wrap { position: relative; padding: 22px; }
.translation-input-wrap { border-right: 1px solid #e2e7e0; }
.translation-input-wrap textarea { width: 100%; min-height: 215px; resize: none; color: #29362d; border: 0; outline: 0; background: transparent; font-size: 17px; line-height: 1.7; }
.translation-input-wrap > span { position: absolute; right: 19px; bottom: 14px; color: #9ba49d; font-size: 10px; }
.translation-output-wrap { background: #f8faf7; }
.translation-output-wrap p { color: #304037; font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.75; white-space: pre-line; }
.translation-output-wrap .copy-button { position: absolute; right: 18px; bottom: 15px; }
.translation-actions { min-height: 65px; display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-top: 1px solid #e2e7e0; }
.translation-actions > span { color: #8d978f; font-size: 10px; }
.translation-actions > span[data-state="error"] { color: #9b343b; }

.value-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 72px 0; }
.value-strip article { display: grid; grid-template-columns: 28px 1fr; gap: 13px; padding-top: 18px; border-top: 1px solid #ccd5cb; }
.value-strip article > span { color: #398058; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.value-strip h3 { font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 500; }
.value-strip p { margin-top: 7px; color: #7b867e; font-size: 12px; line-height: 1.6; }
footer { min-height: 95px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #879188; border-top: 1px solid #d8dfd7; font-size: 11px; }
footer > span:first-child { color: #46534a; font-weight: 760; }

.callback { position: relative; width: min(680px, calc(100% - 36px)); min-height: 100vh; display: grid; align-content: center; justify-items: start; gap: 20px; margin: 0 auto; }
.callback h1 { max-width: 650px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 8vw, 76px); font-weight: 500; line-height: .98; letter-spacing: -.05em; }
.callback > p:not(.eyebrow) { max-width: 580px; color: #6d7870; line-height: 1.7; }
.callback .button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 17px; color: #fff; border-radius: 11px; background: #2d6d46; font-size: 12px; font-weight: 740; }
.callback-language { position: absolute; top: 28px; right: 0; }

.connect-dialog { width: min(500px, calc(100% - 28px)); max-height: calc(100vh - 32px); overflow: auto; padding: 36px; color: #17201a; border: 1px solid #d6ded4; border-radius: 24px; background: #fff; box-shadow: 0 35px 100px #16251a4d; }
.connect-dialog::backdrop { background: #13201999; backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; color: #68736b; border-radius: 50%; background: #f1f4f0; font-size: 20px; }
.connect-dialog h2 { max-width: 400px; margin-top: 12px; font-family: Georgia, "Times New Roman", serif; font-size: 39px; font-weight: 500; line-height: 1.06; letter-spacing: -.04em; }
.dialog-lede { margin-top: 16px; color: #717c74; font-size: 13px; line-height: 1.7; }
.connect-brand { display: flex; align-items: center; gap: 10px; color: #344239; font-size: 12px; font-weight: 760; }
.connect-mark { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; border-radius: 10px; background: #2d6d46; font-family: Georgia, "Times New Roman", serif; font-weight: 700; box-shadow: 0 6px 16px #2d6d4626; }
.connect-preparing { display: flex; align-items: center; gap: 13px; margin-top: 24px; padding: 16px; border: 1px solid #dfe5dd; border-radius: 13px; background: #f8faf7; }
.connect-preparing strong { display: block; color: #344239; font-size: 12px; }
.connect-preparing p { margin-top: 4px; color: #8a948c; font-size: 10px; }
.connect-spinner { width: 22px; height: 22px; flex: 0 0 auto; border: 2px solid #cee0d2; border-top-color: #2d6d46; border-radius: 50%; animation: connect-spin .8s linear infinite; }
@keyframes connect-spin { to { transform: rotate(360deg); } }
.retry-action { width: 100%; margin-top: 15px; }
.result, .error { margin-top: 18px; padding: 17px; border-radius: 13px; }
.result { border: 1px solid #cfe0d1; background: #f2f8f2; }
.result-head { display: flex; align-items: center; gap: 8px; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: #d6a33e; box-shadow: 0 0 0 4px #d6a33e1c; }
.state-dot[data-state="approved"] { background: #4da96a; }
.state-dot[data-state="denied"], .state-dot[data-state="expired"] { background: #ca5d62; }
.result code { display: block; margin-top: 10px; color: #3a6d4a; overflow-wrap: anywhere; font-size: 10px; }
.result > p { margin: 10px 0 14px; color: #69756d; font-size: 12px; line-height: 1.5; }
.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.connect-open-action { flex: 1; }
.secondary-action { min-height: 44px; padding: 0 15px; color: #415047; border: 1px solid #d2dcd2; border-radius: 11px; background: #fff; font-size: 12px; font-weight: 700; }
.install-prompt { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 18px; color: #8a948c; font-size: 11px; }
.install-prompt a { color: #2d6d46; font-weight: 740; text-decoration: underline; text-underline-offset: 3px; }
.error { color: #8f3037; border: 1px solid #edc8ca; background: #fff3f3; font-size: 11px; line-height: 1.55; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; transform: translateX(-50%); padding: 11px 15px; color: #fff; border-radius: 10px; background: #1b3324; box-shadow: 0 10px 40px #1320193d; font-size: 12px; animation: toast-in .2s ease-out; }
.toast[data-kind="error"] { background: #8f3037; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

button:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #77b58a; outline-offset: 2px; }

@media (max-width: 860px) {
  .privacy-note { display: none; }
  .panel-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .panel-heading > p { text-align: left; }
  .writing-grid { grid-template-columns: 1fr; }
  .message { max-width: 90%; }
  .value-strip { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 70px; }
  .brand span, .language-picker { display: none; }
  .hero { padding: 58px 0 32px; }
  .hero h1 { font-size: 49px; }
  .product-workspace { border-radius: 20px; }
  .workspace-header { padding: 13px; }
  .workspace-header h2 { font-size: 13px; }
  .workspace-header p { display: none; }
  .model-status { padding: 6px 8px; }
  .tab-list { padding: 0; }
  .tab { min-height: 68px; gap: 0; }
  .tab-icon { width: 30px; height: 30px; }
  .tab > span:last-child { display: none; }
  .tab + .tab { border-left: 0; }
  .scenario-panel { min-height: 590px; padding: 22px 14px; }
  .panel-heading > div { align-items: flex-start; }
  .panel-heading h3 { font-size: 27px; }
  .chat-messages { min-height: 340px; padding: 16px 12px; }
  .message { max-width: 96%; }
  .composer { grid-template-columns: 1fr 48px; }
  .send-button { min-width: 48px; }
  .send-button > span:first-child { display: none; }
  .document-card { padding: 14px 19px 24px; }
  .translation-grid { grid-template-columns: 1fr; }
  .translation-input-wrap { min-height: 215px; border-right: 0; border-bottom: 1px solid #e2e7e0; }
  .translation-output-wrap { min-height: 230px; }
  .translation-input-wrap textarea { min-height: 160px; }
  .language-row label { padding: 8px; }
  .translation-actions { align-items: flex-start; flex-direction: column; }
  .connect-dialog { padding: 30px 22px 24px; }
  .connect-dialog h2 { font-size: 33px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
