/* Base elements and shared console components. Values follow the prototype. */
* { box-sizing: border-box; }
body { margin: 0; }

header { height: 80px; max-width: 1120px; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
header a { font-size: 32px; font-weight: 800; letter-spacing: -2px; text-decoration: none; color: var(--ink); }
header a span { color: var(--blue); }
.stage-platform header { max-width: none; border-bottom: 1px solid var(--line); } /* the prototype's banner drew this line */

h1 { font-size: 30px; font-weight: 650; line-height: 1.4; letter-spacing: -.7px; margin: 12px 0; }
h1:focus { outline: none; }
p { font-size: 14px; line-height: 1.8; color: var(--muted); }
label { display: block; font-size: 13px; font-weight: 600; margin: 20px 0 8px; }
input { font: inherit; font-size: 15px; background: white; border: 1px solid #ccc; border-radius: 8px; padding: 13px 14px; width: 100%; color: var(--ink); }
input:focus { outline: 2px solid #92a9da; outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--danger); }

/* button */
button { font: inherit; font-size: 14px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 12px 18px; background: white; color: var(--ink); min-height: 44px; }
button:hover { background: #f0f2f7; }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.primary { background: var(--blue); color: white; border-color: var(--blue); width: 100%; margin-top: 24px; }
.primary:hover { background: var(--blue-hover); }
.link { padding: 6px 0; border: 0; background: none; color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.link:hover { background: none; }

.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hint { font-size: 12px; margin: 10px 0; }
.error { color: var(--danger); font-size: 13px; line-height: 1.6; margin-top: 12px; }
.success { font-size: 12px; color: var(--success); }
.required-mark { color: var(--required); font-weight: 600; margin-left: 2px; }

/* section / card */
.card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 28px; margin-top: 24px; }
.s-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0 24px; font-size: 14px; overflow-wrap: anywhere; }
.s-setting-row strong { font-weight: 500; }
.s-connected { color: var(--green); font-size: 11px; flex-shrink: 0; }

/* app shell */
.stage-platform #app { max-width: 1440px; min-height: calc(100vh - 81px); padding: 0; margin: 0 auto; }
.s-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 81px); }
.s-sidebar { border-right: 1px solid var(--line); background: white; padding: 32px 20px; display: flex; flex-direction: column; gap: 28px; }
.s-product { font-size: 23px; font-weight: 700; padding: 0 12px; }
.s-product span { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 7px; }
.s-sidebar nav { display: grid; gap: 8px; }
/* Nav items are links (real pages) drawn with the prototype's button geometry. */
.s-sidebar nav a { display: flex; align-items: center; font-size: 14px; border-radius: 8px; padding: 12px 18px; min-height: 44px; color: var(--ink); text-decoration: none; }
.s-sidebar nav a:hover { background: #f0f2f7; }
.s-sidebar nav a[aria-current] { color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.s-account { margin-top: auto; border-top: 1px solid var(--line); padding: 18px 12px 0; font-size: 12px; display: grid; gap: 14px; overflow-wrap: anywhere; }
.s-account a, .s-content a { color: var(--blue); }
.s-content { padding: 44px 48px; min-width: 0; max-width: 1100px; width: 100%; }
.s-content h1 { margin-top: 0; }
.s-content h2 { font-size: 17px; line-height: 1.5; font-weight: 600; margin: 0 0 16px; }
.s-content .card { max-width: 680px; }
.s-empty { padding: 36px 20px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 14px; }

/* modal dialog */
.s-modal-open { overflow: hidden; }
.s-modal-backdrop { position: fixed; inset: 0; background: rgba(14, 23, 40, .4); z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px; }
.s-dialog { background: white; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; border-radius: 18px; padding: 28px; box-shadow: 0 20px 80px #142e7120; }
.s-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.s-dialog-head h2 { font-size: 20px; margin: 0; }
.s-dialog-head h2:focus { outline: none; }
.s-dialog-head button { font-size: 12px; padding: 8px 12px; }
.s-app-title { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.s-dialog-actions { display: grid; gap: 10px; margin-top: 24px; }
.s-dialog-actions > button { width: 100%; margin-top: 0; }
.s-app-title img { object-fit: contain; flex-shrink: 0; }

/* confirm (inline panel after the page, as in the prototype) */
.confirm-box { max-width: 572px; margin: 20px auto; padding: 20px; background: #fff; border: 2px solid var(--blue); border-radius: 12px; }
.confirm-box p { margin-top: 0; }

@media (max-width: 1100px) { .s-content { padding: 36px 28px; } }
@media (max-width: 700px) {
  header { height: 64px; padding: 0 22px; }
  .s-shell { display: block; }
  .s-sidebar { padding: 16px 20px; border-right: 0; border-bottom: 1px solid var(--line); gap: 14px; }
  .s-product { display: none; }
  .s-sidebar nav { display: flex; }
  .s-account { border: 0; padding: 0; display: flex; justify-content: space-between; font-size: 11px; gap: 12px; }
  .s-content { padding: 28px 20px; }
  .s-dialog { padding: 22px; }
  .s-setting-row { align-items: flex-start; flex-direction: column; gap: 8px; }
}
@media (max-width: 620px) { .confirm-box { margin: 20px; } }
@media (max-width: 600px) { h1 { font-size: 26px; } .card { padding: 22px; } }
.s-account .s-logout { justify-self: start; min-height: 0; font-size: 12px; }
.s-app-badge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 8px; background: var(--blue-soft); color: var(--blue);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em; user-select: none;
}

/* profile menu: the account email opens the workspace switcher (D-126) */
.s-profile summary { cursor: pointer; list-style: none; }
.s-profile summary::-webkit-details-marker { display: none; }
.s-profile summary::after { content: " ▾"; color: var(--muted); }
.s-workspaces-box { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 8px; }
.s-menu-title { color: var(--muted); font-size: 11px; }
.s-workspaces { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.s-workspaces li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.s-workspaces a[aria-current="true"] { color: inherit; font-weight: 600; pointer-events: none; }
.s-current { color: var(--muted); font-size: 11px; white-space: nowrap; }
