:root {
  color-scheme: light;
  font: 16px/1.55 "Inter", "Segoe UI", "Microsoft JhengHei", system-ui, sans-serif;
  color: #172f32; background: #f3f6f4;
  --muted: #4a6565; --edge: #ccd9d5; --teal: #105b52; --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
.workspace, .compact { margin: 0 auto; padding: 3rem 1.4rem; width: min(100%, 61rem); }
.compact { width: min(100%, 32rem); padding-top: min(14vh, 8rem); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.65rem); letter-spacing: -.055em; line-height: 1.2; }
h1 small, h2 small { font-size: .55em; font-weight: 550; letter-spacing: 0; color: var(--muted); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
header, .top, .compact > h1 { margin-bottom: 1.5rem; }
.card, .directory { background: var(--paper); border: 1px solid var(--edge); border-radius: 14px; }
.card { padding: clamp(1rem, 2.8vw, 1.5rem); margin-bottom: 1.15rem; }
.stack, .create, .directory { display: grid; gap: 1rem; }
.create { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: end; margin-top: 1rem; }
label { display: grid; gap: .4rem; min-width: 0; font-weight: 600; font-size: .94rem; }
label small, .meta, .caption, .empty small { font-size: .83rem; font-weight: 500; color: var(--muted); }
.create label { display: block; }
.create label > input, .compound { margin-top: .4rem; }
input:not([type="checkbox"]) { width: 100%; min-width: 0; padding: .63rem .75rem; border: 1px solid #9fb4ae; border-radius: 7px; background: #fff; font: inherit; color: inherit; }
.compound { display: flex; align-items: center; border: 1px solid #9fb4ae; border-radius: 7px; background: #fff; padding-right: .6rem; overflow-wrap: anywhere; }
.compound input:not([type="checkbox"]) { border: 0; }
.compound span { font-size: .8rem; color: var(--muted); }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .55rem .85rem; border: 1px solid var(--edge); border-radius: 7px; background: var(--paper); color: var(--teal); cursor: pointer; font-family: inherit; font-size: .88rem; font-weight: 650; line-height: 1.3; text-decoration: none; }
button:hover, .button:hover { background: #edf5f0; }
button:disabled { opacity: .6; cursor: wait; }
.primary { color: white; background: var(--teal); border-color: var(--teal); }
.primary:hover { background: #08443c; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid #197b71; outline-offset: 2px; }
.danger, .error { color: #9b3838; }
.top, .tools, .address, .actions, .box-head, .box-foot, .pair, .code-row, .pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.tools { margin: 1.5rem 0 .8rem; }
.actions { justify-content: flex-start; gap: .55rem; }
.switch { display: flex; align-items: center; gap: .4rem; cursor: pointer; padding: .45rem 0; }
.switch input { width: 1.1rem; height: 1.1rem; accent-color: var(--teal); }
.caption, .address strong, .code { display: block; }
.address, .issued { background: #e5f2eb; border-color: #aed0c0; }
.address strong { font-size: clamp(1.15rem, 3vw, 1.65rem); margin-top: .25rem; }
.address, .message, .directory, .issued, .compound { overflow-wrap: anywhere; }
.directory { list-style: none; padding: 0; gap: 0; overflow: hidden; margin: .75rem 0; }
.mailbox { padding: 1.15rem; }
.mailbox + .mailbox { border-top: 1px solid var(--edge); }
.state { font-weight: 650; color: var(--muted); font-size: .8rem; }
.state.active { color: var(--teal); }
.note { white-space: pre-wrap; margin-top: .35rem; }
.box-foot, .message .meta, details, .issued p, .pair { margin-top: .65rem; }
.pair { gap: .5rem; padding-top: .65rem; border-top: 1px solid #c0d5c9; }
.issued-link { flex: 1 1 15rem; font-family: monospace; }
.code-row { background: #eff5f2; padding: .8rem 1rem; border-radius: 8px; margin-bottom: .85rem; }
.code { font: 700 1.75rem/1.25 "IBM Plex Mono", Consolas, monospace; letter-spacing: .11em; }
summary { width: fit-content; color: var(--teal); cursor: pointer; font-weight: 600; padding: .35rem 0; }
iframe { width: 100%; height: 16rem; margin-top: .5rem; border: 1px solid var(--edge); border-radius: 6px; background: white; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; border: 1px dashed #aebfb9; border-radius: 12px; }
.toast:not(:empty) { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); background: #183e37; color: white; padding: .6rem 1rem; border-radius: 8px; text-align: center; max-width: calc(100% - 2rem); }
@media (max-width: 680px) {
  .workspace, .compact { padding: 1.6rem .9rem; }
  .create { grid-template-columns: 1fr; }
  .tools, .box-foot { align-items: flex-start; }
  .tools { flex-direction: column; }
  .pair { align-items: flex-start; flex-direction: column; }
  .issued-link { flex: auto; max-width: 100%; }
}
