/* =========================================================
   NOKA CODE — black & white design system
   ========================================================= */
:root {
  --bg: #000;
  --bg-1: #0a0a0a;
  --bg-2: #121212;
  --bg-3: #1a1a1a;
  --line: #262626;
  --line-2: #3a3a3a;
  --fg: #fff;
  --fg-2: #c8c8c8;
  --fg-3: #8a8a8a;
  --danger: #ff6b6b;
  --ok: #e8e8e8;
  --radius: 10px;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;
  --glow: 0 0 6px rgba(255,255,255,.85), 0 0 18px rgba(255,255,255,.45), 0 0 42px rgba(255,255,255,.22);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--fg); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- LED wordmark ---------- */
.wordmark {
  font-weight: 800;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--glow);
  animation: led 3.6s ease-in-out infinite;
}
@keyframes led {
  0%, 100% { text-shadow: var(--glow); }
  50% { text-shadow: 0 0 4px rgba(255,255,255,.7), 0 0 12px rgba(255,255,255,.3), 0 0 28px rgba(255,255,255,.15); }
}
@media (prefers-reduced-motion: reduce) { .wordmark { animation: none; } }

.powered {
  color: var(--fg-3);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.powered strong { color: var(--fg); font-weight: 600; text-shadow: 0 0 8px rgba(255,255,255,.5); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: transparent; color: var(--fg);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--bg-3); border-color: #555; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.btn-primary:hover { background: #e6e6e6; border-color: #e6e6e6; }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { border-color: var(--line-2); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 32px; padding: 0; height: 32px; }
.btn-danger { color: var(--danger); border-color: #4a2222; }
.btn-danger:hover { background: #1f0d0d; border-color: var(--danger); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* =========================================================
   HOME
   ========================================================= */
.home {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(ellipse 60% 40% at 50% 45%, rgba(255,255,255,.07), transparent 70%),
    var(--bg);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
}
.topbar .brand-sm { font-size: 13px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-actions .who { color: var(--fg-3); font-size: 13px; }

.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 22px;
}
.hero .wordmark { font-size: clamp(40px, 9vw, 92px); line-height: 1.05; margin: 0; padding-left: .32em; }
.hero .tagline { color: var(--fg-2); font-size: clamp(15px, 2vw, 18px); margin: 0; max-width: 520px; }
.start-btn {
  margin-top: 10px;
  min-width: 220px; height: 60px;
  font-size: 18px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase;
  padding-left: calc(28px + .28em);
  background: #fff; color: #000; border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 0 0 1px #fff, 0 0 24px rgba(255,255,255,.35), 0 0 60px rgba(255,255,255,.15);
  transition: transform .15s, box-shadow .2s;
}
.start-btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px #fff, 0 0 32px rgba(255,255,255,.55), 0 0 80px rgba(255,255,255,.22); }
.start-btn:active { transform: translateY(0); }
.hero .hint { color: var(--fg-3); font-size: 13px; min-height: 20px; margin: 0; }
.home footer { padding: 22px; text-align: center; }

/* =========================================================
   AUTH
   ========================================================= */
.auth-wrap { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.auth-card {
  width: min(420px, calc(100% - 32px));
  margin: 0 auto; align-self: center;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--bg-1);
  padding: 30px 28px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card .sub { margin: 0 0 22px; color: var(--fg-3); font-size: 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--fg-2); }
.input {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; color: var(--fg);
}
.input:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.input[readonly] { color: var(--fg-2); }
.auth-card .btn-primary { width: 100%; height: 44px; margin-top: 6px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.auth-links a { color: var(--fg-2); text-decoration: none; }
.auth-links a:hover { color: #fff; text-decoration: underline; }
.notice { border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; border: 1px solid var(--line-2); background: var(--bg-2); }
.notice.error { border-color: #5a2a2a; color: #ffc9c9; background: #160a0a; }
.notice.success { border-color: #555; color: #fff; }

/* =========================================================
   WORKSPACE
   ========================================================= */
.ws {
  height: 100%;
  display: grid;
  grid-template-rows: 52px 1fr 26px;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}
.ws-top {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.ws-top .wordmark { white-space: nowrap; font-size: 14px; letter-spacing: .28em; text-decoration: none; margin-right: 6px; }
.ws-top .spacer { flex: 1; }
.project-select {
  height: 34px; max-width: 260px; min-width: 160px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px;
}
.ws-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 400px;
  min-height: 0;
}
.ws-body.with-preview { grid-template-columns: 230px minmax(0, 1fr) minmax(0, 1fr) 400px; }

.panel { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg); }
.panel:last-child { border-right: 0; }
.panel-head {
  height: 40px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 0 8px 0 12px; border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3);
}
.panel-head .actions { display: flex; gap: 4px; }

/* files */
.file-list { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--fg-2);
  font-family: var(--mono); user-select: none;
}
.file-item:hover { background: var(--bg-2); color: #fff; }
.file-item.active { background: #fff; color: #000; }
.file-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; opacity: 0; }
.file-item.dirty .dot { opacity: 1; }
.file-item .more { opacity: 0; border: 0; background: transparent; cursor: pointer; padding: 0 2px; color: inherit; }
.file-item:hover .more, .file-item.active .more { opacity: .7; }
.empty { padding: 18px 14px; color: var(--fg-3); font-size: 13px; }

/* editor */
.editor-wrap { position: relative; flex: 1; min-height: 0; display: flex; background: var(--bg-1); }
.gutter {
  flex: none; width: 52px; padding: 12px 8px 12px 0; text-align: right;
  font-family: var(--mono); font-size: 13.5px; line-height: 21px; color: #555;
  overflow: hidden; user-select: none; border-right: 1px solid var(--line); background: var(--bg);
  white-space: pre;
}
.code {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none;
  padding: 12px 14px; margin: 0;
  background: var(--bg-1); color: #f2f2f2;
  font-family: var(--mono); font-size: 13.5px; line-height: 21px; tab-size: 2;
  white-space: pre; overflow: auto;
}
.code::selection { background: #fff; color: #000; }
.editor-empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--fg-3); background: var(--bg-1); padding: 24px;
}
.editor-empty .wordmark { font-size: 28px; display: block; margin-bottom: 12px; }

/* preview */
.preview-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* AI panel */
.chat { flex: 1; min-height: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.msg { font-size: 14px; line-height: 1.6; }
.msg .who { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.msg.user .bubble { background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant .bubble { color: #eee; word-wrap: break-word; }
.msg.assistant .bubble p { margin: 0 0 10px; }
.msg.assistant .bubble p:last-child { margin-bottom: 0; }
.msg code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.codeblock { border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; margin: 8px 0 12px; background: var(--bg); }
.codeblock .cb-head { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--fg-3); }
.codeblock .cb-head .lang { flex: 1; text-transform: lowercase; font-family: var(--mono); }
.codeblock pre { margin: 0; padding: 10px 12px; overflow: auto; max-height: 420px; }
.codeblock pre code { background: none; border: 0; padding: 0; font-size: 12.5px; line-height: 1.55; white-space: pre; }
.cb-btn { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 5px; border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); cursor: pointer; }
.cb-btn:hover { background: #fff; color: #000; border-color: #fff; }
.msg-actions { display: flex; gap: 4px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .3; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .2; } 40% { opacity: 1; } }
.chat-welcome { color: var(--fg-3); font-size: 13.5px; }
.chat-welcome .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; background: transparent; color: var(--fg-2); cursor: pointer; }
.chip:hover { border-color: #fff; color: #fff; }

.composer { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; }
.composer textarea {
  width: 100%; min-height: 64px; max-height: 220px; resize: vertical;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; outline: none; line-height: 1.5;
}
.composer textarea:focus { border-color: #fff; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--fg-3); }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.toggle input { accent-color: #fff; }

/* status bar */
.statusbar {
  display: flex; align-items: center; gap: 16px; padding: 0 12px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-3); background: var(--bg);
  white-space: nowrap; overflow: hidden;
}
.statusbar .right { margin-left: auto; display: flex; gap: 16px; }

/* menus & dialogs */
.menu {
  position: fixed; z-index: 50; min-width: 220px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.menu button, .menu a {
  display: flex; width: 100%; align-items: center; gap: 10px; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 13.5px; color: var(--fg); text-decoration: none;
}
.menu button:hover, .menu a:hover { background: #fff; color: #000; }
.menu .sep { height: 1px; background: var(--line); margin: 5px 2px; }
.menu .label { padding: 6px 10px 4px; font-size: 11px; color: var(--fg-3); letter-spacing: .12em; text-transform: uppercase; }
.menu .danger { color: var(--danger); }

dialog.modal {
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-1); color: var(--fg);
  padding: 22px; width: min(440px, calc(100% - 32px));
}
dialog.modal::backdrop { background: rgba(0,0,0,.7); }
dialog.modal h2 { margin: 0 0 6px; font-size: 18px; }
dialog.modal p { margin: 0 0 14px; color: var(--fg-3); font-size: 14px; }
dialog.modal .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
dialog.modal .error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 1em; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.radio-row label { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.radio-row input { accent-color: #fff; margin-right: 6px; }

.toast-stack { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast { background: #fff; color: #000; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.toast.error { background: #2a0f0f; color: #ffd0d0; border: 1px solid #5a2a2a; }

/* mobile tabs */
.mobile-tabs { display: none; }
@media (max-width: 1100px) {
  .ws-body, .ws-body.with-preview { grid-template-columns: 200px minmax(0, 1fr) 340px; }
  .ws-body.with-preview #previewPanel { display: none; }
}
@media (max-width: 860px) {
  .ws { grid-template-rows: 52px auto 1fr 0; }
  .statusbar { display: none; }
  .mobile-tabs { display: flex; border-bottom: 1px solid var(--line); }
  .mobile-tabs button { flex: 1; height: 40px; background: transparent; border: 0; color: var(--fg-3); font-size: 13px; border-bottom: 2px solid transparent; }
  .mobile-tabs button.active { color: #fff; border-bottom-color: #fff; }
  .ws-body, .ws-body.with-preview { grid-template-columns: minmax(0, 1fr); }
  .ws-top { gap: 6px; padding: 0 8px; }
  .ws-top .wordmark { font-size: 11px; letter-spacing: .18em; margin-right: 0; }
  .ws-body > .panel { display: none; border-right: 0; }
  .ws-body > .panel.mobile-active { display: flex; }
  .ws-body.with-preview #previewPanel.mobile-active { display: flex; }
  .ws-top .hide-sm { display: none; }
  .project-select { min-width: 90px; flex: 1; }
  .ws-top .spacer { display: none; }
}

/* ---------- small utilities ---------- */
.plain-link { text-decoration: none; }
.page-foot { padding: 22px; text-align: center; }
.composer-buttons { display: flex; gap: 6px; }
.clip-helper { position: fixed; opacity: 0; pointer-events: none; }
.md-list { margin: 0 0 10px; padding-left: 20px; }
.not-found { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 8px; }
.not-found .wordmark { font-size: 28px; margin: 0; }

/* ---------- Home button ---------- */
.topbar-left { display: flex; align-items: center; gap: 14px; }
.home-btn span { margin-left: 0; }

/* ---------- attachments ---------- */
.composer-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.attach-btn { height: 30px; }
.attach-tray { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow: auto; }
.att-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-1); }
.att-item.error { border-color: #5a2a2a; background: #160a0a; }
.att-item.error .att-status { color: #ffc9c9; }
.att-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #111; flex: none; }
.att-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.att-name { font-size: 12.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-status { font-size: 11.5px; color: var(--fg-3); }
.att-bar { height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; position: relative; }
.att-fill { display: block; height: 100%; width: 0; background: #fff; transition: width .15s; }
.att-fill.indeterminate { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.att-remove { border: 0; background: transparent; color: var(--fg-3); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.att-remove:hover { background: #fff; color: #000; }
.att-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.att-img { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.att-video { width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); background: #000; display: block; }
.att-chip { font-size: 12px; color: var(--fg-3); border: 1px dashed var(--line-2); border-radius: 8px; padding: 4px 8px; }
.ts-link { font: inherit; font-family: var(--mono); font-size: 12.5px; padding: 0 5px; margin: 0 1px; border: 1px solid #fff; border-radius: 5px; background: transparent; color: #fff; cursor: pointer; }
.ts-link:hover { background: #fff; color: #000; }
#aiPanel.drop { outline: 2px dashed #fff; outline-offset: -6px; }
@media (max-width: 860px) {
  .ws-top .ws-brand { display: none; }
  .home-btn span, .topbar .powered { display: none; }
}

/* ---------- Settings & integrations ---------- */
.settings-wrap { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.settings { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 8px 0 40px; }
.settings h1 { font-size: 26px; margin: 8px 0 12px; }
.settings h2 { font-size: 19px; margin: 0 0 4px; }
.settings h3 { font-size: 17px; margin: 0; }
.settings h3 .sub { font-size: 12.5px; font-weight: 400; color: var(--fg-3); margin-left: 6px; }
.settings h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg-3); margin: 18px 0 8px; }
.settings-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.settings-tabs a { padding: 8px 12px; color: var(--fg-3); text-decoration: none; border-bottom: 2px solid transparent; font-size: 14px; }
.settings-tabs a.active { color: #fff; border-bottom-color: #fff; }
.section-head { margin-bottom: 12px; }
.muted { color: var(--fg-3); }
.small { font-size: 12.5px; }
.int-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.int-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-1); font-weight: 600; }
.pill { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg-3); white-space: nowrap; }
.pill.on { background: #fff; color: #000; border-color: #fff; }
.int-card { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1); padding: 18px; margin-bottom: 16px; scroll-margin-top: 16px; }
.int-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.explain { font-size: 13.5px; color: var(--fg-2); line-height: 1.6; margin: 0 0 14px; }
.int-body { display: grid; gap: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 14px; }
.field-row .label { color: var(--fg-2); }
.radio { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.radio input { accent-color: #fff; }
.hint { color: var(--fg-3); font-size: 12px; }
.sub-block { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 8px; }
.grid-reply { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 6px; }
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { padding: 0 10px; }
.list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.list-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); font-size: 14px; }
.list-item.col { flex-direction: column; align-items: stretch; gap: 3px; }
.list-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item.mail { cursor: pointer; }
.list-item.mail:hover { border-color: #fff; }
.list-item.unread strong { color: #fff; }
.account { font-size: 13.5px; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
.account.error { border-color: #5a2a2a; color: #ffc9c9; background: #160a0a; }
.perm { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.perm { margin-top: 12px; }
.perm summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.perm ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--fg-2); display: grid; gap: 4px; }
.input-cc { width: 80px; }
.btn-row-end { align-items: flex-end; }
.list-item.due { border-color: #fff; }
.list-item.bad { border-color: #5a2a2a; color: #ffc9c9; background: #160a0a; }
.private-note { margin-top: 10px; }
.export-result { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; display: grid; gap: 4px; }
.export-result p { margin: 0; }
.export-result.error { border-color: #5a2a2a; color: #ffc9c9; background: #160a0a; }
.mail-view { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; }
.mail-view h4 { text-transform: none; letter-spacing: 0; color: #fff; font-size: 15px; margin: 0 0 4px; }
.mail-body { white-space: pre-wrap; font-family: var(--sans); font-size: 13.5px; max-height: 360px; overflow: auto; margin: 8px 0; color: var(--fg-2); }
.att-chat { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #000; background: #fff; }
@media (max-width: 720px) {
  .int-summary { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .int-card { padding: 14px; }
}
