:root {
  --bg: #f5f7fa;
  --surface: #fff;
  --muted: #f7f9fc;
  --text: #182230;
  --soft: #5d6978;
  --border: #dfe5ec;
  --blue: #245fc7;
  --red: #c33b3b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
header, footer, main { width: min(calc(100% - 36px), 1080px); margin: auto; }
header { height: 66px; display: flex; align-items: center; justify-content: space-between; }
body::before { content: ""; position: absolute; left: 0; right: 0; top: 66px; border-top: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 650; text-decoration: none; }
.brand b { display: grid; place-items: center; width: 35px; height: 35px; border-radius:10px; background: var(--blue); color:var(--nk-text); }
.brand strong, .intro small { color: var(--blue); }
nav { display: flex; align-items: center; gap: 22px; }
nav a { color: var(--soft); font-size: 13px; text-decoration: none; }
nav a:hover { color: var(--blue); }
nav button { border: 1px solid var(--border); border-radius:9px; background: var(--surface); color: var(--text); padding: 8px; }
main { padding: 64px 0 55px; }
.intro { text-align: center; max-width: 750px; margin: auto; }
.intro small { font-weight: 750; letter-spacing: .09em; }
.intro h1 { margin: 12px 0 16px; font-size: clamp(34px, 5vw, 50px); line-height: 1.08; letter-spacing: -.045em; }
.intro p { max-width: 650px; margin: 0 auto 34px; color: var(--soft); font-size: 17px; }
.card, .mailbox { max-width: 880px; margin: auto; border: 1px solid var(--border); border-radius:14px; background: var(--surface); box-shadow: 0 4px 16px #1722300a; }
.card { padding: 26px; }
.top { display: flex; justify-content: space-between; gap: 15px; color: var(--soft); font-size: 12px; font-weight: 650; }
.top i { margin-left: 8px; padding: 3px 7px; border-radius:30px; background:#eaf8f0; color:#17824d; font-style: normal; }
.address { display: grid; grid-template-columns: 1fr auto; margin-top: 17px; border:1px solid var(--nk-line); border-radius:11px; overflow: hidden; background: var(--muted); }
.address code { padding: 16px 18px; font-size: 18px; font-weight: 650; overflow-wrap: anywhere; }
.address button { min-width: 115px; border:0; border-left: 1px solid var(--border); background: var(--surface); color: var(--blue); font-weight: 700; }
.actions { display: flex; gap: 10px; margin-top: 15px; }
button { cursor: pointer; color:inherit; }
button:disabled { cursor: wait; opacity: .65; }
.actions button, .mailhead button, .danger { padding: 9px 14px; border: 1px solid var(--border); border-radius:9px; background: var(--surface); font-weight: 700; }
.primary { border-color: var(--blue) !important; background: var(--blue) !important; color:var(--nk-text) !important; }
.danger { color: var(--red); }
#error, .noscript { max-width: 880px; margin: 15px auto; padding: 12px; border-radius:9px; background:#fff0f0; color: var(--red); }
.mailbox { margin-top: 22px; overflow: hidden; }
.mailhead { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.mailhead h2 { margin: 0; font-size: 18px; }
.mailhead em { padding: 3px 8px; border-radius:20px; background:var(--nk-surface); color: var(--blue); font-size: 11px; font-style: normal; }
.mailhead p { margin: 3px 0 0; color: var(--soft); font-size: 13px; }
.empty { text-align: center; padding: 58px 20px; }
.empty > b { display: grid; place-items: center; width: 58px; height: 58px; margin: auto; border: 1px solid var(--border); border-radius:17px; background: var(--muted); font-size: 25px; }
.empty h3 { margin: 14px 0 4px; }
.empty p { margin: 0 0 15px; color: var(--soft); }
.empty small { color:var(--nk-muted); }
.mail { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px 20px; border:0; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; }
.mail:hover, .mail:focus-visible { background: var(--muted); }
.mail.unread strong::after { content: "Nouveau"; margin-left: 8px; padding: 2px 6px; border-radius: 10px; background: #edf4ff; color: var(--blue); font-size: 10px; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius:11px; background:var(--nk-surface); color: var(--blue); font-weight: 800; }
.mail span span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .preview { color: var(--soft); font-size: 12px; }
.trust { max-width: 880px; margin: 27px auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; color: var(--blue); }
.trust div { display: flex; gap: 10px; }
.trust span { display: grid; color: var(--text); }
.trust small { color:var(--nk-muted); }
footer { min-height: 76px; display: flex; align-items: center; justify-content: space-between; color:var(--nk-muted); font-size: 12px; }
dialog { width: min(800px, calc(100% - 24px)); max-height: calc(100vh - 32px); overflow: auto; border:0; border-radius:14px; padding: 24px; background: var(--surface); color: var(--text); }
dialog::backdrop { background:#091019a0; }
dialog iframe, dialog pre { width: 100%; min-height: 320px; border: 1px solid var(--border); background:var(--nk-surface); }
dialog pre { padding: 15px; white-space: pre-wrap; overflow-wrap: anywhere; color:var(--nk-text); }
dialog #meta { color: var(--soft); overflow-wrap: anywhere; }
.close { float: right; border:0; background:none; color: var(--text); font-size: 25px; }
@media (max-width: 700px) {
  nav a { display: none; }
  main { padding-top: 42px; }
  .card { padding: 19px; }
  .top { align-items: flex-start; }
  .address { grid-template-columns: 1fr; }
  .address button { height: 44px; border-left:0; border-top: 1px solid var(--border); }
  .actions { display: grid; }
  .trust { grid-template-columns: 1fr; }
  .mailhead p { display: none; }
  footer { padding: 18px 0; align-items: flex-start; flex-direction: column; }
}


.clipboard-helper{position:fixed;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none}

.message-links { margin: 14px 0; padding: 14px; border: 1px solid var(--border); border-radius:10px; background: var(--muted); }
.message-links strong { display: block; margin-bottom: 8px; }
.message-links a { display: block; margin-top: 6px; color: var(--blue); overflow-wrap: anywhere; }

footer a{color:inherit;text-decoration:none}footer a:hover{text-decoration:underline}

/* NotKoko shared UI foundations v1 — kept local for independent subdomains. */
:root {
  --text-muted: var(--muted);
  --surface-hover: color-mix(in srgb, var(--surface) 92%, var(--text));
  --accent-hover: color-mix(in srgb, var(--accent) 85%, var(--text));
  --success: #278754;
  --warning: #b77919;
  --danger: #d44f59;
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow: 0 6px 24px rgb(0 0 0 / .08);
  --transition: 160ms ease;
}
body { overflow-wrap: break-word; }
main, section, article, .panel, .card { min-width: 0; }
img, video, svg { max-width: 100%; }
:where(button, input, select, textarea) { font: inherit; }
:where(button, .button, .btn, .theme-button, .menu-button, .suggestion-primary) {
  min-height: 44px;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
}
:where(button, .button, .btn, .suggestion-primary):active { transform: translateY(1px); }
:where(button, .button, .btn)[disabled],
:where(button, .button, .btn)[aria-disabled="true"] { cursor: not-allowed; opacity: .62; }
[aria-busy="true"] { cursor: progress; }
body :focus-visible { outline: 3px solid var(--accent, #5289e5); outline-offset: 3px; }
:where(input, select, textarea) { max-width: 100%; }
:where(textarea) { resize: vertical; }
:where(dialog) { max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); }
:where(.table-wrap, .table-responsive) { max-width: 100%; overflow-x: auto; }
:where(.footer-wrap, .footer-inner, .nk-footer) { flex-wrap: wrap; gap: 12px 24px; }
:where(.footer-wrap div, .footer-inner nav, .nk-footer nav) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
:where(.site-footer a, .footer a, .nk-footer a) { display: inline-flex; align-items: center; min-height: 44px; }
:where(.site-footer a, .footer a, .nk-footer a):hover { text-decoration: underline; }
.nk-footer { display: flex; justify-content: space-between; align-items: center; width: min(1180px, calc(100% - 32px)); margin: 32px auto 0; padding: 20px 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; }
.nk-footer a { color:inherit; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* TempMail retains its existing light/dark choice and inbox behaviour. */
body { --text-muted: var(--soft); --accent: var(--blue); --danger: var(--red); }
header { min-height: 66px; height: auto; gap: 12px; padding-block: 8px; }
header nav { gap: 6px 18px; }
header nav a, footer a { display: inline-flex; align-items: center; min-height: 44px; }
.top { flex-wrap: wrap; }
.address { grid-template-columns: minmax(0, 1fr) auto; }
.address code, #subject { overflow-wrap: anywhere; }
dialog .close { min-width: 44px; min-height: 44px; }
dialog pre { border-radius: var(--radius-sm); }
footer { gap: 10px 20px; flex-wrap: wrap; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.empty small, footer { color: var(--soft); }
@media (max-width: 700px) {
  header { flex-wrap: wrap; }
  header nav { margin-left: auto; }
  header nav a, footer nav a { display: inline-flex; }
  .address { grid-template-columns: minmax(0, 1fr); }
  .mail { padding-inline: 14px; gap: 8px; grid-template-columns: 36px minmax(0, 1fr) auto; }
  .mailhead { padding: 16px; gap: 12px; flex-wrap: wrap; }
}
