:root {
  color-scheme: light;
  --ink: #17243a;
  --muted: #65738a;
  --line: #dce3ed;
  --line-soft: #e9edf3;
  --paper: #fff;
  --canvas: #f5f7fa;
  --blue: #2355c7;
  --blue-dark: #1946aa;
  --blue-soft: #edf3ff;
  --red: #b43a42;
  --green: #1d7252;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #88aaff; outline-offset: 2px; }

.site-header { height: 64px; padding: 0 max(28px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #142c59; font-size: 16px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; color: white; background: var(--blue); border-radius: 9px; }
.brand-mark svg { width: 19px; height: 19px; }
.header-note { margin: 0; color: #8290a3; font-size: 12px; }
.main-content { width: min(1120px, calc(100% - 56px)); min-height: calc(100vh - 112px); margin: 0 auto; }
.site-footer { width: min(1120px, calc(100% - 56px)); min-height: 48px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); color: #8290a3; font-size: 11px; }

.login-screen { min-height: calc(100vh - 160px); display: grid; grid-template-columns: minmax(320px, 1fr) minmax(300px, .85fr); align-items: center; gap: 72px; padding: 48px 6.5%; }
.login-copy { max-width: 480px; }
.eyebrow { margin: 0 0 13px; color: var(--blue); font-size: 10px; font-weight: 750; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
.login-copy h1 { margin-bottom: 17px; color: #14243f; font-size: clamp(34px, 4vw, 48px); line-height: 1.16; letter-spacing: -.045em; }
.muted { color: var(--muted); line-height: 1.65; }
.login-copy > .muted { max-width: 410px; margin-bottom: 26px; font-size: 14px; }
.google-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 18px; border: 1px solid #cdd5e0; border-radius: 7px; background: white; color: #23334d; font-size: 14px; font-weight: 650; text-decoration: none; box-shadow: 0 1px 2px #14243f0b; transition: border-color .15s, box-shadow .15s; }
.google-button:hover { border-color: #8fa5c6; box-shadow: 0 3px 9px #14243f15; }
.google-button svg { width: 19px; height: 19px; }
.login-footnote { margin: 15px 0 0; color: #8490a2; font-size: 11px; }
.login-art { position: relative; min-height: 330px; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: linear-gradient(145deg, #1a3d85, #2559c7 60%, #4077de); }
.art-ring { position: absolute; display: block; border: 1px solid #ffffff30; border-radius: 50%; }
.art-ring-one { width: 280px; height: 280px; }
.art-ring-two { width: 370px; height: 370px; }
.vault-illustration { position: absolute; top: 56px; display: grid; width: 150px; height: 150px; place-items: center; filter: drop-shadow(0 14px 18px #1028564a); }
.vault-illustration svg { width: 150px; height: 150px; }
.art-caption { position: absolute; bottom: 39px; color: #ffffffd9; font-size: 14px; line-height: 1.7; text-align: center; }

.status-screen { min-height: calc(100vh - 160px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; }
.status-screen p { margin: 0; }
.spinner { width: 24px; height: 24px; border: 2px solid #d7e0f2; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner-small { width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #fff0ef; color: var(--red); font-size: 22px; font-weight: 700; }
.error-screen h1 { margin: 2px 0 0; color: var(--ink); font-size: 22px; }

.app-screen { padding: 26px 0 52px; }
.account-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 0 21px; border-bottom: 1px solid var(--line); }
.account-details { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.account-label, .published-label { color: #8290a3; font-size: 10px; font-weight: 650; letter-spacing: .035em; }
.account-email { max-width: min(68vw, 480px); overflow: hidden; color: #35435a; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.workspace { padding-top: 36px; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.workspace-heading .eyebrow { margin-bottom: 7px; }
.workspace-heading h1 { margin-bottom: 4px; color: #162742; font-size: 27px; letter-spacing: -.035em; }
.heading-help { margin-bottom: 0; font-size: 12px; }
.publish-box { display: flex; align-items: center; gap: 22px; }
.published-meta { display: flex; flex-direction: column; gap: 5px; text-align: right; }
.published-version { max-width: 180px; overflow: hidden; color: #34445e; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 650; transition: background .15s, border-color .15s, color .15s; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-outline { border-color: #bdcbe0; background: white; color: #244987; }
.button-outline:hover:not(:disabled) { border-color: #7998cc; background: #f8faff; }
.button-quiet { border-color: transparent; background: transparent; color: #52627a; }
.button-quiet:hover:not(:disabled) { background: #eef2f7; color: #263954; }
.button-danger { background: var(--red); color: white; }
.button-danger:hover:not(:disabled) { background: #982d35; }
.button-small { min-height: 30px; padding: 0 8px; font-size: 11px; }
.button-delete { min-height: 30px; padding: 0 7px; border-color: transparent; background: transparent; color: #9c5057; font-size: 11px; }
.button-delete:hover:not(:disabled) { background: #fff1f1; color: #9d2832; }
.button svg { width: 16px; height: 16px; }
.button-icon-label { padding-left: 8px; padding-right: 8px; }

.message { margin: -11px 0 19px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; line-height: 1.5; }
.message-info { background: #f6f8fb; color: #465873; }
.message-success { border-color: #cce6d8; background: #eff9f3; color: var(--green); }
.message-error { border-color: #f0d1d2; background: #fff5f4; color: #a33c42; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-bottom: 7px; }
.key-count { margin: 0; color: #718097; font-size: 11px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
table { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; }
thead { background: #f8f9fb; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
thead th { color: #75839a; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th:first-child { width: 33%; }
thead th:nth-child(2) { width: 48%; }
thead th:last-child { width: 19%; }
.key-cell { font-weight: 500; }
.key-name { color: #263954; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }
.status-badge { display: inline-block; margin: 4px 0 0 7px; padding: 2px 6px; border-radius: 99px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 9px; font-weight: 650; vertical-align: 1px; white-space: nowrap; }
.status-added { background: #eaf7ef; color: #287250; }
.status-changed { background: #fff4df; color: #8a5c16; }
.secret-value { max-width: 100%; max-height: 8.5em; overflow: auto; margin: 0; color: #8290a3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.secret-value-revealed { color: #263954; }
.row-actions { text-align: right; white-space: nowrap; }
.actions-heading { text-align: right; }
.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; color: #8290a3; font-size: 11px; }
.empty-state strong { color: #34445e; font-size: 13px; }
.empty-mark { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 2px; border: 1px solid #c9d6ea; border-radius: 50%; color: var(--blue); font-size: 21px; font-weight: 300; }
.list-loading { min-height: 120px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #718097; font-size: 11px; }
.setup-note { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; color: #65738a; font-size: 11px; }
.setup-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #57a17d; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.setup-note code, .publish-reminder code { padding: 2px 5px; border: 1px solid #dce3ed; border-radius: 4px; background: #fff; color: #34445e; font-size: 10px; }

.dialog { width: min(480px, calc(100% - 32px)); max-height: min(90vh, 760px); overflow: auto; padding: 25px; border: 1px solid #d9e0ea; border-radius: 10px; background: white; color: var(--ink); box-shadow: 0 20px 70px #1c31522b; }
.dialog::backdrop { background: #14243f66; backdrop-filter: blur(2px); }
.dialog-compact { width: min(440px, calc(100% - 32px)); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 9px; }
.dialog-heading .eyebrow { margin-bottom: 5px; }
.dialog-heading h2 { margin: 0; color: #192b48; font-size: 21px; letter-spacing: -.025em; }
.icon-button { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #708097; cursor: pointer; font-size: 23px; line-height: 1; }
.icon-button:hover { background: #f1f3f7; color: #263954; }
.dialog-intro { margin-bottom: 20px; font-size: 12px; }
.field-label { display: block; margin: 13px 0 7px; color: #34445e; font-size: 11px; font-weight: 700; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; }
.field-label-row .field-label { margin-bottom: 7px; }
input[type="text"], textarea { width: 100%; border: 1px solid #cbd5e2; border-radius: 5px; background: white; color: #243651; font-size: 12px; }
input[type="text"] { height: 39px; padding: 0 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
textarea { min-height: 128px; resize: vertical; padding: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.55; }
input[type="text"]::placeholder { color: #a4adba; }
.masked-secret-input { -webkit-text-security: disc; }
.check-label { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: #64738a; font-size: 10px; cursor: pointer; }
.check-label input { accent-color: var(--blue); }
.field-hint { margin: 5px 0 0; color: #8490a2; font-size: 10px; line-height: 1.5; }
.form-error { margin: 12px 0 0; color: #a3323b; font-size: 11px; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.dialog-compact > .muted { margin: 13px 0 0; font-size: 12px; }
.key-inline { padding: 2px 5px; border-radius: 3px; background: #f1f4f8; color: #273954; font-size: 11px; overflow-wrap: anywhere; }
.change-list { max-height: 180px; overflow: auto; margin: 12px 0 0; padding-left: 20px; color: #43536a; font-size: 11px; line-height: 1.8; }
.change-list code { color: #2c4162; font-size: 10px; overflow-wrap: anywhere; }
.publish-reminder { margin: 14px 0 0; color: #738097; font-size: 10px; }

@media (max-width: 760px) {
  .site-header { height: 58px; padding: 0 20px; }
  .main-content, .site-footer { width: calc(100% - 40px); }
  .login-screen { min-height: calc(100vh - 140px); grid-template-columns: 1fr; gap: 30px; padding: 52px 0; }
  .login-copy { max-width: 560px; }
  .login-art { min-height: 230px; }
  .vault-illustration { top: 21px; width: 120px; height: 120px; }
  .vault-illustration svg { width: 120px; height: 120px; }
  .art-ring-one { width: 225px; height: 225px; }
  .art-ring-two { width: 300px; height: 300px; }
  .art-caption { bottom: 17px; font-size: 12px; }
  .app-screen { padding-top: 20px; }
  .workspace { padding-top: 27px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 23px; }
  .publish-box { width: 100%; justify-content: space-between; gap: 12px; }
  .published-meta { text-align: left; }
  .published-version { max-width: 130px; }
  .account-email { max-width: 65vw; }
  .site-footer { min-height: 43px; }
}

@media (max-width: 440px) {
  table { min-width: 0; }
  thead { display: none; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 0; border-bottom: 1px solid var(--line); }
  tbody th, tbody td { border: 0; padding: 6px 14px; }
  .row-actions { text-align: left; }
  .main-content, .site-footer { width: calc(100% - 32px); }
  .site-header { padding: 0 16px; }
  .header-note { font-size: 10px; }
  .login-copy h1 { font-size: 36px; }
  .workspace-heading h1 { font-size: 24px; }
  .list-toolbar { align-items: flex-start; gap: 8px; }
  .toolbar-actions { gap: 3px; }
  .button-icon-label { font-size: 0; }
  .button-icon-label svg { width: 18px; height: 18px; }
  .setup-note { align-items: flex-start; flex-wrap: wrap; line-height: 1.7; }
  .dialog { padding: 20px; }
  .site-footer { font-size: 10px; }
}

.setup-access { margin-bottom: 24px; padding: 24px; scroll-margin-top: 20px; }
.setup-access h2 { margin-top: 0; }
.setup-access .setup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.setup-access input { width: 100%; box-sizing: border-box; }
