/* AEON product cohesion layer
   One navigation model, one content axis, one settings grammar. */
:root{
  --shell-content:920px;
  --shell-wide:1120px;
  --shell-gutter:clamp(24px,4vw,56px);
  --control-height:46px;
  --section-space:28px;
  --top:68px;
}

/* Shared interaction quality */
button,a,input,textarea,select{transition:border-color 140ms ease,background-color 140ms ease,color 140ms ease,opacity 140ms ease,box-shadow 140ms ease}
input::placeholder,textarea::placeholder{color:var(--ink-faint);opacity:1}
.primary-action,.secondary-action,.report-entry{min-height:var(--control-height);padding-inline:20px}
.primary-action:active,.secondary-action:active,.report-entry:active{transform:translateY(1px)}
.quiet-action{min-height:38px}
.danger-link:hover{background:var(--red-soft);color:var(--red)}

/* Navigation is a stable product map, not a toolbar. */
@media (min-width:761px){
  .rail{height:68px;padding-inline:max(28px,calc((100vw - 1360px)/2));gap:12px}
  .rail-brand{margin-inline-end:10px}
  .rail-nav{gap:4px}
  .rail-item{min-height:40px;padding-inline:14px}
  .rail-item span{font-size:13px}
  .rail-menu{top:calc(100% + 10px);width:300px;padding:10px;border:1px solid rgba(215,219,225,.8)}
  .rail-menu-group+.rail-menu-group{margin-top:8px;padding-top:8px}
  .rail-menu-label{padding:8px 11px 6px}
  .rail-menu-item{min-height:46px;padding-inline:11px}
  .rail-menu-item strong{font-size:13px}
  .workspace{inset:68px 0 36px}
}

/* All operational pages start from the same horizontal and vertical axis. */
.worktop{height:auto;min-height:88px;padding-block:20px;background:var(--canvas);border-bottom:0}
.page-head,.conversation-head{width:min(var(--shell-content),calc(100% - 48px));margin-inline:auto;padding-inline:0}
.developer-view .page-head,.admin-view .page-head{width:min(var(--shell-wide),calc(100% - 48px))}
.page-head .eyebrow{margin-bottom:4px}
.conversation-head h2,.page-head h2{font-size:24px;line-height:1.2;letter-spacing:-.02em}

@media (min-width:761px){
  .conversation-view.is-visible,.history-view.is-visible,.profile-view.is-visible,.account-view.is-visible,.admin-view.is-visible,.developer-view.is-visible{display:block}
  .home-stage{min-height:0;align-content:start;padding-top:clamp(68px,10vh,108px);padding-bottom:76px}
  .inquiry-grid{align-self:auto;margin-top:8px;margin-bottom:72px}
  .library-sheet,.profile-sheet,.account-sheet,.admin-sheet,.developer-sheet{align-self:auto;margin-top:8px;margin-bottom:72px}
  .simulation-empty{min-height:0;align-content:start;margin-top:0;padding-top:clamp(54px,8vh,92px)}
}

/* Homepage: calmer hierarchy and less prototype-like whitespace. */
.home-copy h1{font-size:clamp(32px,3.2vw,44px);letter-spacing:-.025em}
.question-composer,.topic-index{border:1px solid var(--line);border-radius:16px;box-shadow:none}
.question-composer{min-height:190px}
.question-composer textarea{min-height:112px}
.topic-index{min-height:190px}
.entrypoint-tabs{overflow-x:auto;scrollbar-width:none}
.entrypoint-tabs::-webkit-scrollbar{display:none}
.entrypoint-tabs button{white-space:nowrap}
.entrypoint{border:1px solid transparent}
.entrypoint:hover{border-color:var(--line-strong)}

/* History, profile, account and admin share continuous settings rows. */
.library-sheet,.profile-sheet,.account-sheet,.admin-sheet,.developer-sheet{border:1px solid var(--line);border-radius:16px;box-shadow:none}
.profile-sheet{width:min(var(--shell-content),calc(100% - 48px));grid-template-columns:repeat(2,minmax(0,1fr));gap:0;padding:0 28px}
.profile-sheet label{gap:10px;padding:24px 0;border-radius:0;border-bottom:1px solid var(--line);background:transparent}
.profile-sheet label:nth-of-type(odd):not(.wide){padding-inline-end:28px}
.profile-sheet label:nth-of-type(even):not(.wide){padding-inline-start:28px;border-inline-start:1px solid var(--line)}
.profile-sheet input,.profile-sheet textarea,.profile-sheet select{min-height:46px;padding:0 14px;border:1px solid transparent;border-radius:11px;background:var(--surface-muted)}
.profile-sheet textarea{padding-block:13px}
.profile-sheet input:hover,.profile-sheet textarea:hover,.profile-sheet select:hover{border-color:var(--line-strong)}
.profile-sheet input:focus,.profile-sheet textarea:focus,.profile-sheet select:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(66,95,209,.16)}
.profile-sheet .wide{padding-block:24px}
.profile-sheet .save-line{min-height:50px;margin:0;padding:14px 0;border-top:0}
.account-sheet{width:min(var(--shell-content),calc(100% - 48px));margin-top:8px}
.admin-sheet{width:min(var(--shell-wide),calc(100% - 48px));margin-top:8px}
.settings-section{padding:30px 32px;gap:42px}
.settings-form input,.auth-form input,.admin-search input,.invitation-create-form select{min-height:46px;background:#fbfbfc}
.settings-form input:hover,.auth-form input:hover,.admin-search input:hover,.invitation-create-form select:hover{border-color:var(--line-strong)}
.settings-form input:focus,.auth-form input:focus,.admin-search input:focus,.invitation-create-form select:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(66,95,209,.16)}
.admin-tabs,.developer-tabs{padding:12px 14px;gap:4px;background:#fbfbfc}
.admin-tab,.developer-tabs button{min-height:38px}
.admin-empty,.history-empty{display:grid;min-height:180px;place-items:center;padding:32px;color:var(--ink-faint)}

/* Developer surfaces may be dense, but must not float in the middle of a blank canvas. */
.developer-sheet{width:min(var(--shell-wide),calc(100% - 48px));margin-top:8px}
.developer-doc{padding:42px 48px}
.developer-app-toolbar{padding:26px 28px}

/* Conversation is one reading column; current action stays visually attached. */
.inquiry-grid{width:min(var(--shell-content),calc(100% - 48px));gap:14px}
.inquiry-log,.agent-composer{border:1px solid var(--line);border-radius:16px;box-shadow:none}
.inquiry-log{max-height:220px}
.agent-composer{padding:30px 32px}
.message-body{font-size:14px;line-height:1.75}
.surface-footer{margin-top:24px;padding-top:18px}
.loading-line{min-height:150px}

/* Authentication remains focused, now works on short screens and exposes language. */
.auth-gate{padding:20px;overflow:auto;overscroll-behavior:contain}
.auth-gate{scrollbar-width:none}
.auth-gate::-webkit-scrollbar{display:none}
.auth-gate.is-open{display:flex;align-items:center;justify-content:center}
.auth-panel{width:min(460px,100%);max-height:none;padding:34px;border-radius:16px;overflow:visible}
.auth-panel:has(#register-form.is-visible){width:min(520px,100%)}
.auth-brand{justify-content:space-between}
.auth-logo{width:122px}
.auth-language{max-width:148px;min-height:34px;padding:0 12px;overflow:hidden;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--ink-soft);font-size:11px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.auth-language:hover{background:var(--surface-muted);color:var(--ink)}
.auth-heading{margin:32px 0 22px}
.auth-heading h1{font-size:28px}
.auth-form{gap:15px}
.auth-form .primary-action{margin-top:6px}
.remember-row{padding-block:6px;background:#f4f5f7}

/* Sheets use the same proportions and empty-state behavior. */
.settings-drawer{width:min(520px,100vw);border-radius:24px 0 0 24px}
[dir="rtl"] .settings-drawer{border-radius:0 24px 24px 0}
.connection-head{padding-top:26px}
.connection-loading{min-height:180px}
.connection-panel{min-height:0}
.drawer-scrim{background:rgba(19,22,27,.28)}

/* Legal information is present but never competes with the task. */
.site-legal{height:36px;gap:11px;font-size:10px}
.site-legal-links{gap:11px}

/* Public surfaces keep their content modes but share one company-scale header. */
.journal-header,.legal-topbar{height:68px;min-height:68px;padding-inline:max(28px,calc((100vw - var(--shell-wide))/2));border-bottom:1px solid var(--line)}
.journal-brand img,.legal-logo{width:118px}
.journal-header nav,.legal-top-actions{gap:16px}
.journal-index,.article-page,.legal-layout{width:min(var(--shell-wide),calc(100% - 48px))}
.journal-footer,.legal-footer{min-height:54px;padding-inline:max(28px,calc((100vw - var(--shell-wide))/2))}
.status-page{width:min(var(--shell-wide),calc(100% - 48px));padding-top:18px}
.status-nav{min-height:50px;margin-bottom:18px}

@media (max-width:760px){
  :root{--shell-gutter:16px}
  body{min-width:320px}
  .view{padding-bottom:92px}
  .site-legal{display:none}
  .workspace{min-height:100dvh}
  .home-stage{width:calc(100% - 28px);padding:34px 0 28px}
  .home-copy h1{font-size:29px}
  .question-composer,.topic-index{border-radius:16px}
  .question-composer{padding:18px;min-height:0}
  .question-composer textarea{min-height:104px;font-size:16px}
  .topic-index{padding:17px}
  .entrypoint-tabs{display:flex;padding:3px}
  .entrypoint-tabs button{flex:0 0 auto;padding-inline:13px}
  .rail{bottom:max(10px,env(safe-area-inset-bottom));box-shadow:0 16px 46px rgba(20,24,32,.18)}
  .rail-item span{font-size:10px}
  .rail-menu{bottom:calc(82px + env(safe-area-inset-bottom));max-height:calc(100dvh - 116px)}
  .worktop{position:relative;min-height:76px;padding:14px 16px}
  .page-head,.conversation-head,.developer-view .page-head,.admin-view .page-head{width:100%;margin:0}
  .page-head .eyebrow{display:none}
  .conversation-head h2,.page-head h2{font-size:22px}
  .library-sheet,.profile-sheet,.account-sheet,.admin-sheet,.developer-sheet{width:calc(100% - 24px);margin:0 auto 28px}
  .profile-sheet{display:grid;grid-template-columns:1fr;padding:0 16px}
  .profile-sheet label,.profile-sheet label:nth-of-type(odd):not(.wide),.profile-sheet label:nth-of-type(even):not(.wide){padding:20px 0;border-inline-start:0;border-bottom:1px solid var(--line)}
  .profile-sheet .save-line{padding:14px 0}
  .settings-section{grid-template-columns:1fr;gap:18px;padding:22px 20px}
  .inquiry-grid{width:calc(100% - 24px);margin:0 auto 28px}
  .conversation-stream,.agent-composer{padding:18px}
  .inquiry-log,.agent-composer{border-radius:16px}
  .developer-doc{padding:28px 20px}
  .auth-gate{padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom))}
  .auth-gate.is-open{align-items:flex-start}
  .auth-panel,.auth-panel:has(#register-form.is-visible){width:100%;margin:auto 0;padding:24px;border-radius:16px}
  .auth-heading{margin:26px 0 20px}
  .auth-heading h1{font-size:26px}
  .auth-register-pair{grid-template-columns:1fr}
  .captcha-field{grid-template-columns:minmax(0,1fr) 132px}
  .remember-row{grid-template-columns:1fr;gap:7px;padding:10px}
  .duration-segments span{min-width:0}
  .settings-drawer{right:8px;left:8px;width:auto;border-radius:22px;max-height:calc(100dvh - 16px)}
  .journal-header,.legal-topbar{height:62px;min-height:62px;padding-inline:16px}
  .journal-header nav a:not(:last-of-type){display:none}
  .journal-header nav{gap:8px}
  .journal-header .i18n-public-trigger,.legal-topbar .i18n-public-trigger{max-width:108px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .journal-index,.article-page,.legal-layout{width:calc(100% - 28px)}
  .journal-footer,.legal-footer{padding-inline:16px}
  .status-page{width:calc(100% - 28px);padding-top:10px}
  .status-nav-actions{gap:7px}
  .status-nav-actions .i18n-public-trigger{max-width:104px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

@media (max-height:720px){
  .auth-gate.is-open{align-items:flex-start}
  .auth-panel{margin-block:0}
}

@media (prefers-reduced-motion:reduce){
  button,a,input,textarea,select{transition:none}
  .primary-action:active,.secondary-action:active,.report-entry:active{transform:none}
}

@media (prefers-contrast:more){
  .question-composer,.topic-index,.library-sheet,.profile-sheet,.account-sheet,.admin-sheet,.developer-sheet,.inquiry-log,.agent-composer{border-color:var(--line-strong)}
}
