:root {
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#202b3e;
  background:#f6f7f9;
  font-synthesis:none;
  --accent:#315eea;
  --border:#e6e9ef;
  --muted:#7b8596;
  --red:#b33939
}

* {
  box-sizing:border-box
}

body {
  margin:0
}

button,input,textarea,select {
  font:inherit
}

button,select {
  cursor:pointer
}

button {
  color:inherit
}

button:disabled {
  opacity:.45;
  cursor:not-allowed
}

button,a,input,textarea,select {
  touch-action:manipulation
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible {
  outline:3px solid #8faeff;
  outline-offset:3px
}

[hidden] {
  display:none!important
}

a {
  color:inherit;
  text-decoration:none
}

.app-shell {
  max-width:1192px;
  margin:auto;
  padding:0 40px;
  padding-top:env(safe-area-inset-top);
  padding-left:max(40px,env(safe-area-inset-left));
  padding-right:max(40px,env(safe-area-inset-right));
  padding-bottom:env(safe-area-inset-bottom);
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  flex-direction:column
}

.topbar {
  height:104px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--border);
  gap:16px
}

.brand {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:29px;
  font-weight:750;
  letter-spacing:-1px
}

.brand-dot {
  color:var(--accent)
}

.topbar-actions {
  display:flex;
  gap:12px;
  align-items:center
}

.status-pill {
  font-size:12px;
  color:#5b6b7e;
  display:flex;
  align-items:center;
  gap:7px
}

.status-pill:before {
  content:"";
  width:6px;
  height:6px;
  background:#8b96a6;
  border-radius:50%
}

.status-pill.ready:before {
  background:#36a777
}

.intro {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:50px 0 36px
}

.eyebrow {
  font-size:10px;
  letter-spacing:1.8px;
  color:var(--muted);
  font-weight:650;
  margin:0 0 11px
}

h1 {
  font-size:clamp(34px,4.5vw,50px);
  line-height:1.1;
  letter-spacing:-1.8px;
  font-weight:650;
  margin:0
}

.intro-copy {
  font-size:14px;
  color:#778293;
  margin:18px 0 0;
  line-height:1.6
}

.privacy-note {
  display:flex;
  align-items:center;
  gap:14px;
  color:#8993a2;
  font-size:12px;
  line-height:1.8;
  padding:18px 0
}

.privacy-note strong {
  font-weight:500;
  color:#536074
}

.privacy-icon {
  font-size:40px;
  font-weight:300;
  color:#aab9d3
}

.workspace {
  display:grid;
  grid-template-columns:284px minmax(0,1fr);
  gap:20px;
  align-items:stretch
}

.panel {
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 5px 18px #253c5b03
}

.key-panel {
  display:flex;
  flex-direction:column;
  padding:24px 18px 18px;
  min-width:0
}

.panel-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:0 6px 20px
}

h2 {
  font-size:19px;
  letter-spacing:-.5px;
  font-weight:650;
  margin:0
}

.count {
  font-size:11px;
  color:#8490a3;
  background:#f1f3f7;
  border-radius:6px;
  padding:3px 7px;
  vertical-align:middle;
  margin-left:5px
}

.icon-button {
  border:1px solid var(--border);
  background:white;
  border-radius:10px;
  min-width:42px;
  min-height:42px;
  font-size:24px;
  font-weight:400;
  display:inline-grid;
  place-items:center
}

.icon-button:hover {
  background:#f4f6fb
}

.key-list {
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:330px;
  overflow:auto
}

.key-item {
  width:100%;
  text-align:left;
  border:1px solid transparent;
  background:#fafbfc;
  border-radius:11px;
  padding:15px 13px;
  display:flex;
  align-items:center;
  gap:12px;
  min-height:72px
}

.key-item[aria-pressed=true] {
  background:#f0f4ff;
  border-color:#dce5ff
}

.key-symbol {
  font-size:19px;
  color:#96a0af;
  flex:none;
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:8px;
  background:#f0f2f6
}

.key-item[aria-pressed=true] .key-symbol {
  color:var(--accent);
  background:#e3eaff
}

.key-detail {
  min-width:0;
  flex:1
}

.key-name {
  font-size:13px;
  font-weight:600;
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}

.key-print {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:10px;
  display:block;
  color:#8793a7;
  margin-top:7px
}

.key-check {
  color:var(--accent);
  font-size:13px;
  flex:none
}

.key-empty {
  text-align:center;
  padding:24px 0 30px;
  color:#929baa
}

.empty-symbol {
  font-size:32px;
  color:#9badd3;
  margin-bottom:17px
}

.key-empty h3 {
  color:#4c5a70;
  font-size:14px
}

.key-empty p {
  font-size:12px;
  line-height:1.8;
  margin-bottom:20px
}

.key-tools {
  display:flex;
  justify-content:space-between;
  margin:10px 7px 25px;
  gap:6px
}

.key-panel-bottom {
  margin-top:auto;
  padding-top:24px
}

.key-panel-bottom p {
  font-size:10px;
  color:#949dac;
  line-height:1.8;
  margin:12px 4px 0
}

.button {
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border-radius:9px;
  padding:11px 18px;
  border:1px solid transparent;
  font-size:12px;
  font-weight:550;
  background:white;
  transition:background .15s,transform .15s
}

.button:active:not(:disabled) {
  transform:translateY(1px)
}

.primary {
  background:var(--accent);
  color:#fff;
  box-shadow:0 3px 6px #315eea15
}

.primary:hover:not(:disabled) {
  background:#244bd0
}

.secondary {
  border-color:var(--border);
  background:#fff;
  color:#56647b
}

.secondary:hover:not(:disabled) {
  background:#f7f9fe
}

.quiet {
  background:transparent;
  border-color:var(--border);
  color:#69758a
}

.compact {
  min-height:38px;
  padding:8px 12px;
  font-size:11px
}

.full {
  width:100%
}

.text-button {
  border:0;
  background:transparent;
  color:var(--accent);
  font-size:11px;
  padding:8px 0;
  min-height:36px
}

.text-button:hover {
  text-decoration:underline
}

.muted {
  color:var(--muted)
}

.destructive {
  color:var(--red)
}

.message-panel {
  overflow:hidden
}

.message-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:20px 24px;
  border-bottom:1px solid #eef0f4
}

.segmented {
  display:inline-flex;
  background:#f0f2f6;
  border-radius:9px;
  padding:4px;
  gap:3px
}

.segmented button {
  background:transparent;
  border:0;
  border-radius:6px;
  padding:10px 16px;
  color:#8490a2;
  font-size:12px;
  font-weight:550;
  min-height:38px;
  flex:1
}

.segmented button[aria-pressed=true] {
  background:white;
  color:#344059;
  box-shadow:0 1px 4px #18264012
}

.format-picker {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:10px;
  color:#8a93a2
}

.format-picker select {
  font-size:11px;
  color:#4b5870;
  border:1px solid var(--border);
  border-radius:7px;
  background:white;
  min-height:38px;
  padding:6px 8px
}

.editor-section {
  padding:16px 25px 0
}

.field-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:38px;
  margin-bottom:9px
}

.field-heading label {
  font-size:11px;
  font-weight:600;
  color:#59677e
}

textarea {
  display:block;
  width:100%;
  border:0;
  resize:vertical;
  background:transparent;
  color:#2b3851;
  font-size:14px;
  line-height:1.8;
  min-height:100px;
  padding:5px 0;
  overflow-wrap:anywhere;
  border-radius:3px
}

textarea::placeholder {
  color:#a1aabb
}

textarea:focus {
  outline:0
}

textarea:focus-visible {
  outline:2px solid #c9d6ff;
  outline-offset:6px
}

#input-text {
  min-height:145px;
  max-height:55vh
}

#output-text {
  min-height:112px;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px
}

#output-text::placeholder {
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:13px
}

.editor-meta {
  display:flex;
  justify-content:space-between;
  font-size:10px;
  color:#a1aabb;
  padding:10px 0 16px
}

.action-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  padding:15px 24px;
  border-top:1px solid #f0f2f6
}

.action-row p {
  font-size:10px;
  color:#8893a6;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.action-row p::before {
  content:"●";
  color:#a7b7d6;
  margin-right:7px;
  font-size:7px
}

.action-row .button {
  min-width:167px
}

.result-section {
  background:#fafbfe;
  border-top:1px solid var(--border);
  padding:16px 24px 10px
}

.result-footer {
  display:flex;
  align-items:center;
  gap:8px;
  color:#9ca6b5;
  font-size:10px;
  min-height:43px
}

.result-footer p {
  flex:1;
  line-height:1.6
}

.small-lock {
  color:#91a1bc
}

.workspace-note {
  font-size:10px;
  color:#929cac;
  text-align:center;
  margin:20px 0 30px;
  line-height:1.7
}

footer {
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border-top:1px solid var(--border);
  padding:22px 0 25px;
  font-size:10px;
  color:#96a0af
}

.footer-dot {
  padding:0 7px
}

.notice {
  font-size:12px;
  line-height:1.7;
  border-radius:10px;
  padding:15px 17px;
  margin:16px 0
}

.notice p {
  margin:7px 0 0
}

.danger {
  background:#fff4ee;
  border:1px solid #f2d7c7;
  color:#8c4d35
}

.update {
  background:#eaf0ff;
  color:#3c548c;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px
}

.inline-error {
  font-size:12px;
  color:var(--red);
  line-height:1.6;
  margin:12px 24px
}

.toast {
  position:fixed;
  bottom:max(25px,env(safe-area-inset-bottom));
  left:50%;
  transform:translateX(-50%);
  padding:14px 20px;
  color:#fff;
  background:#25334e;
  box-shadow:0 5px 25px #0002;
  border-radius:12px;
  z-index:10;
  font-size:12px;
  max-width:calc(100% - 32px);
  text-align:center
}

dialog {
  border:1px solid var(--border);
  border-radius:20px;
  padding:28px;
  width:460px;
  max-width:calc(100vw - 30px);
  max-height:85vh;
  max-height:85dvh;
  overflow:auto;
  box-shadow:0 20px 100px #18264020;
  color:#28364c
}

dialog::backdrop {
  background:#15203f66;
  backdrop-filter:blur(4px)
}

.dialog-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:24px
}

.dialog-heading h2 {
  font-size:23px;
  line-height:1.3
}

.dialog-heading .icon-button {
  border:0;
  color:#98a2b2;
  background:#f5f6f9;
  flex-shrink:0
}

.form-label {
  display:block;
  font-size:12px;
  font-weight:600;
  margin:23px 0 10px
}

input:not([type=checkbox]),dialog textarea {
  width:100%;
  background:#f8f9fc;
  border:1px solid var(--border);
  border-radius:9px;
  padding:13px 14px;
  font-size:14px;
  color:#344059
}

dialog textarea {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:13px
}

.field-help {
  color:#8a95a8;
  font-size:11px;
  line-height:1.8;
  margin:12px 0 22px
}

.checkbox-label {
  display:flex;
  gap:10px;
  align-items:flex-start;
  font-size:12px;
  line-height:1.7;
  margin:20px 0
}

.checkbox-label input {
  width:19px;
  height:19px;
  accent-color:var(--accent);
  flex-shrink:0
}

.dialog-description {
  font-size:13px;
  color:#758196;
  line-height:1.8
}

.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:24px
}

dialog .inline-error {
  margin:14px 0
}

dialog .segmented {
  margin-bottom:3px
}

.help-content h3 {
  font-size:14px;
  margin-top:25px
}

.help-content p {
  font-size:12px;
  line-height:1.9;
  color:#7b879b
}

.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
}

body.modal-open {
  overflow:hidden
}

.vault-screen {
  display:grid;
  place-items:center;
  padding:40px 0 60px
}

.vault-card {
  max-width:420px;
  width:100%;
  padding:28px
}

.vault-card h2 {
  font-size:23px
}

.vault-card .inline-error {
  margin:14px 0
}

.vault-card .field-help {
  margin-bottom:12px
}

.vault-card .button {
  margin-top:10px
}

.vault-card .form-label {
  margin-top:17px
}

@media(min-width:1400px) {
  .intro {
    padding-top:65px;
    padding-bottom:45px
  }
  .workspace {
    grid-template-columns:300px minmax(0,1fr)
  }
  #input-text {
    min-height:190px
  }
}

@media(max-width:800px) {
  .app-shell {
    padding-left:max(22px,env(safe-area-inset-left));
    padding-right:max(22px,env(safe-area-inset-right))
  }
  .workspace {
    grid-template-columns:235px minmax(0,1fr);
    gap:14px
  }
  .message-header {
    flex-wrap:wrap;
    padding:16px
  }
  .message-header .segmented {
    flex:1
  }
  .message-header .segmented button {
    padding:9px 12px
  }
  .format-picker {
    justify-content:space-between;
    width:100%
  }
  .editor-section {
    padding-left:18px;
    padding-right:18px
  }
  .action-row,.result-section {
    padding-left:18px;
    padding-right:18px
  }
  .action-row {
    align-items:stretch;
    flex-direction:column;
    gap:2px
  }
  .action-row p {
    margin:0 0 10px
  }
  .privacy-note {
    display:none
  }
}

@media(max-width:600px) {
  .app-shell {
    padding-left:max(16px,env(safe-area-inset-left));
    padding-right:max(16px,env(safe-area-inset-right))
  }
  .topbar {
    height:78px
  }
  .brand {
    font-size:25px;
    gap:8px
  }
  .brand img {
    width:32px;
    height:32px
  }
  .topbar-actions {
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end
  }
  .status-pill {
    font-size:10px
  }
  .topbar-actions .button {
    font-size:10px;
    min-height:34px;
    padding:6px 8px
  }
  #lock-button {
    border:0;
    padding-left:0;
    padding-right:0
  }
  .intro {
    padding:32px 0 26px
  }
  h1 {
    font-size:36px;
    letter-spacing:-1.3px
  }
  .intro-copy {
    font-size:12px;
    margin-top:13px
  }
  .eyebrow {
    font-size:9px;
    letter-spacing:1.4px
  }
  .workspace {
    grid-template-columns:minmax(0,1fr);
    gap:16px
  }
  .key-panel {
    padding:18px
  }
  .panel-heading {
    margin:0 0 14px
  }
  .panel-heading h2 {
    font-size:17px
  }
  .panel-heading .eyebrow {
    margin-bottom:6px
  }
  .key-list {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    max-height:195px;
    gap:7px
  }
  .key-item {
    padding:12px 9px;
    gap:7px;
    min-height:68px
  }
  .key-symbol {
    width:23px;
    height:28px;
    font-size:16px
  }
  .key-name {
    font-size:12px
  }
  .key-print {
    font-size:9px;
    letter-spacing:-.2px
  }
  .key-tools {
    margin:4px 0 6px
  }
  .key-panel-bottom {
    padding-top:10px;
    display:flex;
    gap:12px;
    align-items:center
  }
  .key-panel-bottom .button {
    width:auto;
    white-space:nowrap;
    font-size:11px;
    padding:9px 12px
  }
  .key-panel-bottom p {
    font-size:9px;
    margin:0
  }
  .key-empty {
    padding:5px 0 10px
  }
  .key-empty .empty-symbol {
    display:none
  }
  .key-empty h3 {
    margin:4px 0
  }
  .key-empty p {
    margin:8px 0
  }
  .key-empty .button {
    display:none
  }
  .message-header {
    padding:16px;
    flex-wrap:nowrap;
    gap:10px
  }
  .message-header .segmented {
    min-width:0
  }
  .segmented button {
    font-size:11px;
    padding:10px 9px
  }
  .format-picker {
    width:auto;
    flex:none
  }
  .format-picker>span {
    display:none
  }
  .format-picker select {
    font-size:11px;
    max-width:85px
  }
  .editor-section {
    padding-top:14px
  }
  textarea,input:not([type=checkbox]),dialog textarea {
    font-size:16px
  }
  #output-text {
    font-size:13px
  }
  .action-row {
    flex-direction:row;
    align-items:center;
    padding-top:14px;
    padding-bottom:14px;
    gap:12px
  }
  .action-row p {
    max-width:42%;
    margin:0;
    line-height:1.8;
    white-space:normal;
    overflow-wrap:anywhere
  }
  .action-row .button {
    min-width:155px
  }
  .result-footer {
    font-size:10px;
    align-items:flex-start;
    padding-top:6px
  }
  .result-footer .small-lock {
    padding-top:12px
  }
  .result-footer .text-button {
    font-size:10px
  }
  footer {
    font-size:9px;
    gap:8px;
    padding-bottom:20px;
    flex-wrap:wrap
  }
  footer .text-button {
    font-size:10px
  }
  .workspace-note {
    font-size:10px;
    margin:17px 8px 22px
  }
  .dialog-heading h2 {
    font-size:21px
  }
  dialog {
    padding:23px
  }
  .privacy-note {
    display:none
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
    transition:none!important
  }
}
