@font-face {
  font-family: "Dovie Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/noto-serif-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Dovie Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/noto-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  color: #eee4d7;
  background: #24171c;
  --bg: #24171c;
  --surface: #2c1c22;
  --field: #352229;
  --gold: #d2b575;
  --gold-bright: #e2c993;
  --ink: #eee4d7;
  --muted: #b6a19d;
  --line: #4a343c;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-width: 280px; min-height: 100vh; margin: 0; background: var(--bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, input, a { outline-offset: 5px; }
:focus-visible { outline: 2px solid var(--gold); }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(100% - 96px, 1120px); height: 110px; margin: 0 auto; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; border-radius: 3px; color: var(--ink); text-decoration: none; font-size: 23px; font-weight: 600; letter-spacing: -.7px; }
.brand-logo { display: block; width: 60px; height: 60px; object-fit: contain; }
.workspace { width: min(100% - 96px, 920px); margin: clamp(48px, 8vh, 88px) auto 72px; }
.workspace-heading { margin: 0 0 36px; }
h1 { margin: 0; color: var(--ink); font-family: "Dovie Serif", "Times New Roman", serif; font-size: clamp(35px, 4vw, 48px); line-height: 1.35; font-weight: 400; letter-spacing: -1px; text-wrap: balance; }
h1 > span { color: var(--gold); }
.lookup-surface { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.lookup-pane { min-width: 0; padding: 30px 34px 32px; }
.field-label { display: block; color: var(--muted); font-size: 13px; font-weight: 450; line-height: 1.5; }
.input-row { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding: 6px; border: 1px solid #62434a; border-radius: 5px; background: var(--field); transition: border-color .15s, box-shadow .15s; }
.input-row:focus-within { border-color: #b69a66; box-shadow: 0 0 0 3px #d2b5750a; }
.input-row:has(input[aria-invalid="true"]) { border-color: #ce8883; }
.input-wrap { position: relative; width: 100%; min-width: 0; flex: 1; }
input { display: block; width: 100%; min-width: 0; height: 46px; padding: 0 44px 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.5; caret-color: var(--gold); }
input::placeholder { color: #a58a8d; opacity: 1; }
input:focus { outline: none; }
.clear { position: absolute; display: grid; place-items: center; right: 0; top: 1px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 3px; color: #b19698; background: transparent; transition: color .15s, background-color .15s; }
.clear svg { width: 16px; height: 16px; }
.clear:hover { color: var(--ink); background: #473039; }
.search-button { display: inline-flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 24px; min-width: 136px; min-height: 46px; padding: 0 17px; border: 1px solid var(--gold); border-radius: 3px; color: #352222; background: var(--gold); font-size: 14px; font-weight: 600; transition: background-color .15s, border-color .15s, transform .15s; }
.search-button:hover:not(:disabled) { background: var(--gold-bright); border-color: var(--gold-bright); }
.search-button:disabled { background: #aa9366; border-color: #aa9366; color: #352222; }
.search-button:active:not(:disabled), .copy-button:active:not(:disabled) { transform: translateY(1px); }
.button-icon { position: relative; display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; }
.button-icon > svg { position: absolute; inset: 0; width: 18px; height: 18px; transition: opacity .15s, transform .15s; }
.search-spinner { position: absolute; inset: 1px; border: 1.5px solid #35222244; border-top-color: #352222; border-radius: 50%; opacity: 0; transition: opacity .15s; }
.search-button[aria-busy="true"] .search-arrow { opacity: 0; transform: translateX(3px); }
.search-button[aria-busy="true"] .search-spinner { opacity: 1; animation: spin .8s linear infinite; }
.result { min-width: 0; min-height: 249px; margin: 0 34px; padding: 27px 0 30px; border-top: 1px solid var(--line); }
.result-title { display: flex; align-items: center; justify-content: space-between; }
.result h2 { margin: 0; color: var(--muted); font-size: 13px; font-weight: 450; line-height: 1.5; }
.result-marker { width: 6px; height: 6px; background: #6c4d4f; border-radius: 50%; transition: background-color .15s; }
.result[data-state="success"] .result-marker { background: var(--gold); }
.result-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 117px; margin-top: 7px; }
.code { display: flex; align-items: center; min-height: 94px; min-width: 0; color: #9a7b79; font-family: "Cascadia Mono", Consolas, monospace; font-size: 36px; font-weight: 400; line-height: 1.2; letter-spacing: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .18s; }
.result[data-state="success"] .code { color: var(--gold-bright); font-size: 64px; letter-spacing: 14px; }
.result[data-state="loading"] .code { color: #6c4d4f; }
.result-context { min-height: 42px; margin-top: 4px; }
.result-message { max-width: 100%; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; text-wrap: pretty; overflow-wrap: anywhere; }
.result[data-state="error"] .result-message { color: #edb1a5; }
.mail-details { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 24px; max-width: 100%; color: #d2b8af; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.mail-details time { color: #aa9290; font-size: 12px; font-variant-numeric: tabular-nums; }
.copy-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 9px; min-height: 44px; min-width: 142px; padding: 0 14px; border: 1px solid #6f5547; border-radius: 4px; background: transparent; color: var(--gold-bright); font-size: 13px; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s, transform .15s; }
.copy-button:hover:not(:disabled) { border-color: var(--gold); background: #49352d; }
.copy-button:disabled { color: #947b74; border-color: #523b3f; }
.copy-button .button-icon, .copy-button .button-icon > svg { width: 16px; height: 16px; flex-basis: 16px; }
.check-icon { opacity: 0; transform: scale(.7); }
.copy-button[data-copied="true"] { color: var(--gold-bright); border-color: var(--gold); }
.copy-button[data-copied="true"] .copy-icon { opacity: 0; transform: scale(.7); }
.copy-button[data-copied="true"] .check-icon { opacity: 1; transform: scale(1); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .workspace { width: calc(100% - 56px); }
  .result[data-state="success"] .code { font-size: 48px; letter-spacing: 8px; }
  .code { font-size: 27px; letter-spacing: 2px; }
}
@media (max-width: 540px) {
  .topbar { width: calc(100% - 36px); height: 88px; gap: 14px; }
  .brand { font-size: 22px; gap: 5px; }
  .brand-logo { width: 50px; height: 50px; }
  .workspace { width: calc(100% - 36px); margin-top: 40px; }
  .workspace-heading { margin-bottom: 25px; }
  h1 { font-size: 34px; letter-spacing: -1px; }
  .lookup-pane { padding: 24px 20px; }
  .input-row { flex-wrap: wrap; gap: 4px; }
  .input-wrap { flex-basis: 100%; }
  input { height: 48px; padding-left: 9px; }
  .search-button { width: 100%; min-height: 46px; justify-content: center; gap: 18px; }
  .result { min-height: 295px; margin: 0 20px; padding-top: 24px; padding-bottom: 24px; }
  .result-main { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 13px; margin-top: 10px; }
  .code { min-height: 90px; font-size: 25px; letter-spacing: 2px; }
  .result[data-state="success"] .code { font-size: clamp(34px, 11vw, 48px); letter-spacing: 6px; }
  .copy-button { width: 100%; }
  .result-context { margin-top: 20px; }
  .mail-details { flex-direction: column; gap: 2px; }
}
@media (min-width: 541px) and (max-height: 720px) {
  .topbar { height: 84px; }
  .workspace { margin-top: 32px; margin-bottom: 28px; }
  .workspace-heading { margin-bottom: 24px; }
  h1 { font-size: 38px; }
  .lookup-pane { padding-top: 24px; padding-bottom: 24px; }
  .result { min-height: 214px; padding-top: 22px; padding-bottom: 22px; }
  .result-main { min-height: 102px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
  .search-button:active:not(:disabled), .copy-button:active:not(:disabled) { transform: none; }
}
