:root {
  --ink: #e8f3f5;
  --dim: #8fb0b8;
  --deep: #02030c;
  --glass: rgba(10, 14, 36, 0.8);
  --line: rgba(170, 190, 255, 0.18);
  --primary: #5fd4c4;
  --outstanding: #ff8a7a;
  --progress: #ffc86b;
  --unclear: #8aa7c2;
  --done: #7be0a4;
  --declined: #6b7c86;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--deep); color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; overflow: hidden; }
#sea { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#sea.dragging { cursor: grabbing; }
#sea.pointing { cursor: pointer; }

#top { position: fixed; top: 14px; left: 16px; right: 16px; display: flex; gap: 12px; align-items: center;
  pointer-events: none; flex-wrap: wrap; }
#top > * { pointer-events: auto; }
.brand { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; color: var(--dim); }
#q { width: min(420px, 60vw); padding: 9px 14px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--glass); color: var(--ink); font: inherit; outline: none; backdrop-filter: blur(6px); }
#q:focus { border-color: var(--primary); }
#chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--glass); color: var(--ink); border-radius: 14px;
  padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip.off { opacity: .38; }

#panel { position: fixed; top: 64px; right: 16px; bottom: 16px; width: min(460px, calc(100vw - 32px));
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  overflow-y: auto; backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
#panel h2 { margin: 0 28px 4px 0; font-size: 17px; line-height: 1.35; }
#panel h3 { margin: 18px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
#panel p { margin: 6px 0; }
#panel .sub { color: var(--dim); font-size: 13px; }
#close { position: absolute; top: 10px; right: 12px; font-size: 22px; line-height: 1; }
button.quiet { background: none; border: none; color: var(--dim); cursor: pointer; font: inherit; }
button.quiet:hover { color: var(--ink); }
button.primary { background: var(--primary); color: #032; border: none; border-radius: 16px; padding: 6px 14px;
  font: inherit; font-weight: 600; cursor: pointer; }
.pill { display: inline-block; border-radius: 10px; padding: 1px 9px; font-size: 12px; margin-right: 6px; color: #021; font-weight: 600; }
.row { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); cursor: pointer; }
.row:hover .t { color: #fff; }
.row .t { flex: 1; }
.row .m { color: var(--dim); font-size: 12px; white-space: nowrap; }
.mail { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.mail summary { cursor: pointer; list-style: none; }
.mail summary::-webkit-details-marker { display: none; }
.mail .who { font-weight: 600; }
.mail pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; color: #d4e6ea; }
.mail .quoted { color: var(--dim); border-left: 2px solid var(--line); padding-left: 10px; margin-top: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--dim); }
.bar { height: 8px; border-radius: 4px; overflow: hidden; display: flex; margin: 6px 0; background: rgba(255,255,255,.06); }
.bar span { display: block; height: 100%; }

#hint { position: fixed; left: 16px; bottom: 14px; color: var(--dim); font-size: 12px; pointer-events: none; }
#legend { position: fixed; left: 16px; bottom: 40px; color: var(--dim); font-size: 12px; pointer-events: none; line-height: 1.8; }
#legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: -1px; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; color: var(--dim); pointer-events: none; }
@media (max-width: 700px) { #legend, #hint { display: none; } }
#sea, #hint, #legend, .brand { user-select: none; -webkit-user-select: none; }
#panel { overflow-x: hidden; overflow-wrap: anywhere; }
#panel a { color: var(--primary); text-decoration: none; }
#panel a:hover { text-decoration: underline; }

#me { margin-left: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px;
  font-size: 12px; display: flex; gap: 10px; align-items: center; max-width: 520px; }
#me[hidden] { display: none; }
#me .sub { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#me a { color: var(--dim); text-decoration: none; }
#me a:hover { color: var(--ink); }
#loading:has(.gate) { pointer-events: auto; }
.gate { max-width: 440px; padding: 28px 30px; background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  color: var(--ink); backdrop-filter: blur(10px); }
.gate h1 { margin: 0 0 8px; font-size: 22px; }
.gate h3 { margin: 22px 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.gate .sub { color: var(--dim); font-size: 13px; }
.gate select { width: 100%; margin: 8px 0 12px; padding: 8px; border-radius: 8px; background: #0a0e24; color: var(--ink);
  border: 1px solid var(--line); font: inherit; }
a.primary, button.primary { display: inline-block; background: var(--primary); color: #032; border: none; border-radius: 18px;
  padding: 8px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
body > .gate { margin: 18vh auto; }

.kv .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 0; }
#legend { background: rgba(6, 8, 24, 0.72); border-radius: 10px; padding: 6px 10px; }
