:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f5f0e9;
  background: #161616;
  --muted: #c3b9ae;
  --line: #413830;
  --surface: #211f1d;
  --accent: #ffad65;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1080px; margin: 0 auto; padding: 35px 24px 72px; }
.top, .account, .intro, .mailbox-head, .mailbox-tools, .aside-head, .inbox-head, .dialog-head,
.form-actions, .code-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top, .intro, .mailbox-head, .aside-head, .inbox-head, .dialog-head { justify-content: space-between; }
.top { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.brand { font-size: 1.18rem; font-weight: 760; letter-spacing: -.035em; }
.brand span { color: var(--accent); }
.account { flex-wrap: wrap; justify-content: flex-end; }
#account-name { overflow-wrap: anywhere; color: var(--muted); font-size: .9rem; }
.intro { padding: clamp(28px, 5vw, 50px) 0 23px; align-items: flex-end; }
h1 { font-size: clamp(2rem, 7vw, 3.5rem); margin: 0; line-height: 1.07; letter-spacing: -.055em; }
h2 { margin: 0; font-size: 1.08rem; letter-spacing: -.015em; }
p { margin: 0; line-height: 1.55; color: var(--muted); }
.intro p { margin-top: 9px; }
button, input, select { font: inherit; }
button {
  cursor: pointer; font-weight: 650; min-height: 41px; padding: 9px 14px;
  border-radius: 6px; border: 1px solid transparent; color: #231407; background: var(--accent);
}
button:hover { background: #ffc291; }
button:disabled { opacity: .52; cursor: wait; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.secondary { color: #f5f0e9; background: #2b2824; border-color: #4d4238; }
.secondary:hover { background: #373128; }
.small { font-size: .88rem; }
.text-button { background: transparent; color: var(--muted); padding-inline: 7px; }
.text-button:hover { color: #fff; background: #393127; }
.danger-text { color: #f4a694; }
.danger { background: #ffab9b; }
.danger:hover { background: #ffc8bb; }
.notice { color: #f1c49f; }
.notice:not(:empty) { margin: 0 0 12px; }
.workspace { display: grid; grid-template-columns: minmax(0, 248px) minmax(0, 1fr); border: 1px solid var(--line); }
.workspace.guest { grid-template-columns: minmax(0, 1fr); }
.box-list { background: #1b1a19; border-right: 1px solid var(--line); min-width: 0; }
.aside-head { padding: 12px 12px 9px 16px; }
.aside-head button { font-size: .8rem; }
.empty-list { padding: 0 16px 18px; font-size: .88rem; }
#boxes { list-style: none; padding: 0 7px 8px; margin: 0; }
.box-link {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px;
  text-align: left; width: 100%; padding: 9px 8px;
  color: #f5f0e9; font-weight: 500; border: 1px solid transparent; background: transparent;
}
.box-link:hover { background: #2b251f; }
.box-link[aria-current="true"] { border-color: #694c35; background: #34271c; }
.box-address, .address strong, .code-row input { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.box-address { font-size: .83rem; }
.shared { color: var(--muted); font-size: .73rem; }
.inbox { min-width: 0; min-height: 180px; background: var(--surface); }
.mailbox-head { padding: 16px; align-items: flex-start; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.address, .mailbox-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.address { min-height: 41px; }
.address strong { font-size: clamp(.94rem, 3vw, 1.14rem); }
.badge {
  font-size: .75rem; line-height: 1.3; padding: 3px 6px; border: 1px solid currentColor;
  border-radius: 3px; color: #ddd6ce; overflow-wrap: anywhere;
}
.badge[data-color="orange"] { color: #ffb97e; }
.badge[data-color="green"] { color: #abd59d; }
.badge[data-color="blue"] { color: #a8d5f6; }
.badge[data-color="purple"] { color: #dfbaf9; }
.inbox-head { padding: 14px 16px 11px; }
.box-status { color: var(--muted); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }
#empty { padding: 0 16px 17px; }
details { border-top: 1px solid var(--line); padding: 10px 16px; }
summary { padding: 5px 0; cursor: pointer; overflow-wrap: anywhere; }
summary::marker { color: var(--accent); }
.sender { font-size: .85rem; margin: 8px 0 4px; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.55; }
dialog {
  min-width: 0; width: min(445px, calc(100% - 30px)); padding: 18px;
  background: var(--surface); color: #f5f0e9; border: 1px solid #6e5340; border-radius: 10px;
}
dialog::backdrop { background: #12100ed5; }
.dialog-head { margin-bottom: 12px; }
.close { font-size: 1.35rem; width: 41px; }
form, .sharing { display: grid; gap: 13px; }
label { display: grid; gap: 6px; font-size: .91rem; }
input, select {
  width: 100%; min-width: 0; min-height: 43px; padding: 8px 10px;
  background: #161616; color: #f5f0e9; border: 1px solid #605244; border-radius: 5px;
}
.code-row input { flex: 1; }
.code-row button { flex-shrink: 0; }
.form-actions { flex-wrap: wrap; align-items: center; }
#dialog-status:not(:empty) { margin: 12px 0 0; }
@media (max-width: 640px) {
  main { padding: 21px 14px 45px; }
  .intro { flex-wrap: wrap; align-items: flex-start; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .box-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .box-link { justify-content: flex-start; }
}
@media (max-width: 360px) {
  .top, .account { gap: 5px; }
  .account button { font-size: .8rem; padding-inline: 7px; }
}
