:root {
  color-scheme: light;
  --ink: #101d2b;
  --teal: #006b80;
  --teal-hover: #005367;
  --muted: #476071;
  --line: #d6e4e8;
  --wash: #f3f8fa;
  --soft: #e7f3f5;
  --shell: 1110px;
  color: var(--ink);
  font: 16px/1.5 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--wash); margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; min-width: 0; }
a { color: var(--teal); text-underline-offset: .2em; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.17; }
h2 { font-size: 1.43rem; }
h3 { font-size: 1.08rem; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
.shell { width: min(var(--shell), calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; z-index: 2; top: 12px; left: 12px; padding: .6rem 1rem; background: #fff; border-radius: 7px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.loading, #global-error { margin-block: 3rem; }

.site-header { background: #fff; border-bottom: 1px solid #e5eef0; }
.site-header-inner, .site-footer > .shell { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand img { display: block; width: clamp(34px, 4vw, 46px); height: auto; }
.brand img:last-child { width: clamp(137px, 19vw, 200px); }
.header-links { display: flex; gap: 15px; align-items: center; }
.header-links > a:not(.button) { font-weight: 600; }
.account-email { color: var(--muted); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; max-width: min(27vw, 300px); white-space: nowrap; }
.site-footer { border-top: 1px solid #e4eef0; background: #fff; color: var(--muted); font-size: .88rem; }
.site-footer > .shell { min-height: 60px; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .67rem;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: .54rem .93rem;
  color: var(--teal);
  background: #fff;
  font-size: .95rem;
  line-height: 1.25;
  font-weight: 680;
  text-decoration: none;
}
.button-primary { background: var(--teal); color: #fff; box-shadow: 0 2px 3px #0b465014; }
.button-primary:hover:not(:disabled) { background: var(--teal-hover); }
.button-outline { border-color: #a9c7cf; }
.button-outline:hover:not(:disabled) { background: var(--wash); border-color: var(--teal); }
.button-danger { background: #9c3338; color: #fff; }
.button-danger:hover { background: #772629; }
.button-icon { width: 44px; flex: none; padding: 0; font-size: 1.5rem; }
.button-icon:hover { background: var(--wash); }

.welcome {
  background:
    linear-gradient(105deg, #f4fbfdf5 7%, #f5fbfcdf 33%, #eff8fa44 100%),
    url('/assets/hero.webp') center 55% / cover no-repeat;
  min-height: min(660px, calc(100dvh - 136px));
  display: grid;
  align-items: center;
}
.welcome-inner { display: grid; grid-template-columns: 1.2fr minmax(320px, .75fr); align-items: center; gap: clamp(26px, 7vw, 96px); padding-block: clamp(56px, 10vw, 130px); }
.welcome-message h1 { font-size: clamp(3.1rem, 7.1vw, 5.9rem); font-weight: 760; color: #0b1524; letter-spacing: -.065em; line-height: .99; margin-bottom: 1.2rem; }
.welcome-message h1 span { color: #007281; }
.welcome-message > p { max-width: 36ch; color: #143347; font-size: clamp(1.07rem, 1.75vw, 1.22rem); font-weight: 550; }
.panel.welcome-panel { padding: clamp(24px, 4vw, 43px); box-shadow: 0 18px 50px #0c304724, 0 3px 12px #0c304722; }
.welcome-panel p { margin-top: .65rem; color: var(--muted); }
.welcome-actions { display: grid; gap: .65rem; margin-top: 1.3rem; }
.preview-form { display: grid; gap: 1rem; margin-top: 1.05rem; }
.preview-form .field { margin-top: 0; }

.workspace-banner {
  background: linear-gradient(90deg, #edf8fafc 9%, #eff8fad9 52%, #e8f3f76f 100%), url('/assets/hero.webp') center 47% / cover no-repeat;
  border-bottom: 1px solid #dfebee;
  padding-block: clamp(36px, 6vw, 66px);
}
.workspace-banner h1 { font-size: clamp(2.17rem, 5vw, 3.6rem); letter-spacing: -.06em; }
.workspace-banner p { font-size: 1.05rem; margin-top: .45rem; color: #183b4d; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .95fr); align-items: start; gap: 21px; padding-block: clamp(24px, 4vw, 46px); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(21px, 3vw, 30px); box-shadow: 0 7px 17px #153e5009; min-width: 0; }
.panel-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 1.43rem; }
.panel-heading p { color: var(--muted); margin-top: .3rem; font-size: .95rem; }
.panel-icon { width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center; background: var(--soft); color: var(--teal); border-radius: 10px; }
.panel-icon svg { width: 24px; height: 24px; }
.empty { background: var(--wash); border: 1px dashed #bfd6db; border-radius: 11px; padding: 1.05rem; margin: 0 0 .95rem; }
.empty p, .help { color: var(--muted); font-size: .92rem; margin-top: .35rem; }
.item-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.item-list:empty { display: none; }
.item-list > li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.item-list > li:first-child { border-top: 1px solid var(--line); }
.item-list > li > div { min-width: 0; overflow-wrap: anywhere; }
.item-list .button { flex: none; font-size: .85rem; }

.notice { border: 1px solid #c7dde3; border-radius: 8px; background: var(--wash); color: #174458; padding: .7rem .85rem; margin-top: .9rem; overflow-wrap: anywhere; }
.notice[data-error] { background: #fff2f2; color: #832c31; border-color: #f1c9cb; }

dialog { color: var(--ink); width: min(600px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 4vw, 28px); box-shadow: 0 20px 80px #0c304733; }
dialog::backdrop { background: #10253687; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.dialog-heading h2 { font-size: 1.51rem; }
.field { margin-top: .82rem; }
.field label, .field-label { display: block; font-size: .95rem; font-weight: 660; margin-bottom: .33rem; }
.field input { color: var(--ink); background: #fff; border: 1px solid #a8bdc5; border-radius: 8px; display: block; min-height: 44px; width: 100%; padding: .55rem .78rem; }
.field input[readonly] { background: var(--wash); }
.form-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.1rem; align-items: center; }
.form-actions .button { text-align: center; }
.copy-field { display: flex; align-items: stretch; }
.copy-field input { border-radius: 8px 0 0 8px; min-width: 0; font-family: ui-monospace, monospace; font-size: .89rem; }
.copy-field .button { border-radius: 0 8px 8px 0; border-left: 0; }
#confirm-dialog { width: min(460px, calc(100% - 32px)); }
#confirm-text { color: var(--muted); }

@media (max-width: 790px) {
  .workspace-grid, .welcome-inner { grid-template-columns: 1fr; }
  .workspace-grid { max-width: 625px; }
  .welcome-inner { max-width: 540px; }
  .welcome { background-position: 60% center; }
}

@media (max-width: 520px) {
  .shell { width: calc(100% - 32px); }
  .site-header-inner { min-height: 66px; }
  .header-links, .brand { gap: 5px; }
  .header-links > a { font-size: .83rem; }
  .account-email { display: none; }
  .welcome-inner { padding-block: 54px; }
  .workspace-grid { gap: 13px; }
  .item-list > li { align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

.header-links .button { white-space: nowrap; }
.optional { color: var(--muted); font-weight: 480; }
.steps { margin: .75rem 0 0; padding-inline-start: 1.4rem; color: var(--muted); font-size: .94rem; }
.steps > li { padding-inline-start: .2rem; margin-bottom: .46rem; }
.scope-note { color: #174458; background: var(--wash); border-radius: 7px; padding: .63rem .82rem; overflow-wrap: anywhere; }
.aws-actions { margin: .9rem 0 1rem; }
.storage-choices { display: grid; gap: .6rem; }
.storage-choice {
  display: grid;
  gap: .22rem;
  width: 100%;
  padding: .85rem .95rem;
  border: 1px solid #a9c7cf;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.storage-choice:hover { border-color: var(--teal); background: var(--wash); }
.storage-choice strong { color: var(--teal); font-size: 1rem; }
.storage-choice span { color: var(--muted); font-size: .92rem; }
.region-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.region-fieldset legend { margin: 0; padding: 0; font-weight: 660; }
.managed-region-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-top: .66rem; }
.managed-region {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 64px;
  padding: .55rem .72rem;
  border: 1px solid #a9c7cf;
  border-radius: 9px;
  cursor: pointer;
}
.managed-region:hover, .managed-region:has(input:checked) { background: var(--wash); border-color: var(--teal); }
.managed-region input { margin: 0; accent-color: var(--teal); }
.managed-region > span { display: grid; }
.managed-region strong { font-size: .94rem; }
.managed-region span span { color: var(--muted); font-size: .88rem; }
.managed-files { border-top: 1px solid var(--line); margin-top: 1.14rem; padding-top: 1rem; }
.managed-upload { display: flex; align-items: start; gap: .55rem; flex-wrap: wrap; margin: .72rem 0 .8rem; }
.managed-upload .field { flex: 1 1 14rem; min-width: 0; margin-top: 0; }
.managed-upload .button { margin-top: 1.76rem; }
.managed-upload input::file-selector-button {
  border: 0;
  border-radius: 5px;
  margin-right: .5rem;
  padding: .12rem .48rem;
  background: var(--soft);
  color: var(--teal);
  font: inherit;
  cursor: pointer;
}
#managed-files-status { margin-bottom: .65rem; }
.mcp-steps { margin-top: .85rem; }
.mcp-client-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 1.22rem 0 .64rem; }
.mcp-client-heading .button { min-height: 38px; }
.client-actions { display: flex; flex-wrap: wrap; gap: .32rem; justify-content: end; }
.client-status { font-weight: 650; color: #006472; font-size: .89rem; }
.subtle-action { color: #86323a; }

@media (max-width: 520px) {
  .form-actions .button { min-height: 42px; }
  .item-list > li { flex-wrap: wrap; }
  .managed-region-list { grid-template-columns: 1fr; }
  .managed-upload .field { flex-basis: 100%; }
  .managed-upload .button { margin-top: 0; }
  .client-actions .button { min-height: 40px; }
}

/* Personal and client-owned workspace controls */
.workspace-toolbar {
  display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; padding-top: clamp(20px, 3vw, 30px);
}
.workspace-selection { flex: 1 1 220px; max-width: 440px; }
.workspace-selection label { display: block; font-weight: 660; margin-bottom: .3rem; }
.workspace-selection select, .workspace-invite-fields select {
  display: block; width: 100%; min-height: 44px; padding: .5rem .75rem;
  border: 1px solid #a8bdc5; border-radius: 8px; background: #fff; color: var(--ink); font: inherit;
}
.workspace-tools { display: flex; flex-wrap: wrap; gap: .55rem; }
.workspace-management { grid-column: 1 / -1; }
.workspace-management h3 { margin-top: .9rem; }
.workspace-management .item-list { margin-top: .7rem; }
.workspace-invite-form { padding-block: .6rem; border-top: 1px solid var(--line); }
.workspace-invite-fields {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(135px, .55fr) auto;
  align-items: end; gap: .7rem; margin-block: .7rem;
}
.workspace-invite-fields .field { margin: 0; }
.workspace-invite-fields .button { margin-bottom: 0; }
.workspace-invites-heading { margin-top: 1.1rem; }
#workspace-invite-result { margin: .6rem 0 1rem; }
#workspace-invite-result .copy-field { margin-top: .35rem; }
#workspace-invite-link { display: block; width: 100%; min-width: 0; padding: .5rem .65rem; }
.workspace-members .member-details { display: grid; gap: .14rem; }
.workspace-members .member-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.workspace-members .member-actions select {
  min-height: 40px; border: 1px solid #a8bdc5; border-radius: 8px; padding: .25rem .35rem;
  background: #fff; color: var(--ink); font: inherit; font-size: .9rem;
}
@media (max-width: 760px) {
  .workspace-invite-fields { grid-template-columns: 1fr; }
  .workspace-invite-fields .button { justify-self: start; }
}
@media (max-width: 520px) {
  .workspace-tools { width: 100%; }
  .workspace-tools .button { flex: 1; }
  .workspace-selection { max-width: none; }
}

.header-links { flex-wrap: wrap; justify-content: end; }
.workspace-events { margin-top: 1rem; }
.workspace-events summary { color: var(--muted); cursor: pointer; }
#invite-enroll { margin-top: .3rem; }
#storage-access-members { margin-top: 1rem; }
#shared-folder-list { max-height: 50vh; overflow-y: auto; }
#shared-folder-list > li > span { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .site-header-inner { flex-wrap: wrap; padding-block: 12px; }
  .header-links { justify-content: start; }
  .header-links .button { min-height: 40px; }
}

