:root {
  color-scheme: light;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #242337; background: #f5f5fa;
  --ink: #242337; --muted: #656578; --line: #e4e3ed; --accent: #5740bb;
}
* { box-sizing: border-box; }
body { margin: 0; }
input, select, button { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
:focus-visible { outline: 3px solid #8166e3; outline-offset: 3px; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner, main { width: min(1450px, 94%); margin: auto; }
.top-inner, .brand, .account { display: flex; align-items: center; }
.top-inner { min-height: 62px; justify-content: space-between; gap: 12px; }
.brand { gap: 10px; font-size: 22px; font-weight: 720; letter-spacing: -.05em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: #6247c8; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; }
.brand-mark::before { inset: 9px 6px; border: 1.6px solid white; border-radius: 3px; }
.brand-mark::after { width: 10px; height: 10px; top: 6px; left: 10px; border: solid white; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.account { gap: 10px; min-width: 0; font-size: 12px; color: var(--muted); }
.account select { font-size: 13px; font-weight: 550; color: var(--ink); background: #f6f5fb; border: 1px solid var(--line); padding: 8px; border-radius: 9px; max-width: 100%; }
main { padding: clamp(20px,3vw,42px) 0 32px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(30px,3.8vw,50px); line-height: 1.05; letter-spacing: -.055em; font-weight: 650; margin-bottom: 23px; }
form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: stretch; margin-bottom: 22px; }
.searchbar, .date-field { background: #fff; border: 1px solid #d5d3e2; border-radius: 13px; display: flex; align-items: center; }
.searchbar { padding: 5px 5px 5px 17px; gap: 9px; }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #e8e1ff; }
.search-input { display: flex; align-items: center; flex: 1; min-width: 0; gap: 14px; }
.lens { display: block; position: relative; width: 15px; height: 15px; border: 1.8px solid #79758a; border-radius: 50%; flex-shrink: 0; }
.lens::after { content: ""; position: absolute; width: 7px; height: 2px; background: #79758a; transform: rotate(45deg); right: -5px; bottom: -3px; }
#query { border: 0; outline: 0; font-size: 16px; height: 39px; min-width: 0; width: 100%; background: transparent; }
.primary { padding: 10px 15px; font-weight: 600; background: var(--accent); border-radius: 9px; color: white; }
.primary span { margin-left: 8px; opacity: .8; }
.primary:hover { background: #44309b; }
.date-field { gap: 10px; padding: 4px 12px; }
.date-field span { font-size: 12px; color: var(--muted); }
#asof { border: 0; background: transparent; font-size: 14px; min-width: 0; }
#shortcuts { grid-column: 1/-1; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
#shortcuts button, #more { font-size: 13px; border-radius: 20px; padding: 5px 12px; background: #fff; border: 1px solid #dadae6; }
#shortcuts button:hover, #more:hover { color: var(--accent); border-color: #b6a8e8; }
#date-hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.workspace { display: grid; grid-template-columns: minmax(0, 40%) minmax(0,1fr); align-items: start; border: 1px solid var(--line); border-radius: 17px; background: #fff; overflow: clip; box-shadow: 0 7px 25px #2c224109; }
.workspace > section { padding: 20px 12px; height: clamp(490px,68vh,880px); display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
#results-title { font-size: 21px; letter-spacing: -.035em; margin: 0 8px; }
#status, .meta { font-size: 12px; color: var(--muted); }
#status { margin: 3px 8px 14px; }
#period { margin: 8px 8px 2px; color: #57418e; font-size: 13px; }
#rows { overflow: auto; scrollbar-color: #d3cede transparent; min-height: 0; }
.mail { border: 0; background: transparent; text-align: left; width: 100%; overflow-wrap: anywhere; }
#rows .mail { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 5px 9px; padding: 12px 10px; border-radius: 8px; border-bottom: 1px solid #efedf4; }
#rows .mail:hover, #related .mail:hover { background: #f6f4fb; }
#rows .mail[aria-current="true"] { background: #f0ebff; box-shadow: inset 3px 0 #7458d1; }
.mail strong { grid-column: 1; grid-row: 1; font-size: 14px; line-height: 1.4; font-weight: 625; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail time { grid-column: 2; grid-row: 1; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.preview { grid-column: 1/-1; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
#rows h3 { font-size: 12px; margin: 16px 8px 5px; color: var(--muted); }
#more { margin: 10px auto 0; }
article { min-width: 0; padding: clamp(20px,3vw,45px); max-height: clamp(490px,68vh,880px); overflow: auto; }
#subject { font-size: clamp(21px,2.1vw,30px); line-height: 1.23; letter-spacing: -.035em; overflow-wrap: anywhere; }
#stamp:not(:empty) { margin-bottom: 12px; color: var(--accent); }
#body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 20px; line-height: 1.7; }
#similar { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
#similar h3 { font-size: 16px; }
#related .mail { display: block; padding: 10px 2px; color: var(--accent); border-bottom: 1px solid var(--line); }
mark { background: #ffe4a0; border-radius: 3px; color: inherit; }
.empty-art { display: none; }
article:has(#body:empty) { align-self: stretch; display: grid; align-content: center; justify-items: center; text-align: center; background: radial-gradient(ellipse at center,#f6f2fd 0%,white 65%); }
article:has(#body:empty) #subject { font-size: 21px; }
article:has(#body:empty) .empty-art { display: block; width: 130px; height: 115px; position: relative; margin-bottom: 10px; }
.empty-art i,.empty-art b,.empty-art span { position: absolute; border-radius: 8px; width: 83px; height: 57px; left: 23px; top: 29px; }
.empty-art i { background: #dfd6f7; transform: translate(-9px,-7px) rotate(-17deg); }
.empty-art b { background: #bca9eb; transform: translate(7px,-10px) rotate(12deg); }
.empty-art span { overflow: hidden; background: #7556c4; transform: rotate(-6deg); box-shadow: 0 7px 10px #45306520; }
.empty-art span::before { content:""; position:absolute; width:62px; height:62px; background:#9378d7; left:9px; top:-36px; transform:rotate(45deg); border-radius:6px; }
@media(max-width:800px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace > section { height:auto; max-height:48vh; border-right:0; border-bottom:1px solid var(--line); }
  article { max-height:none; min-height:190px; }
  article:has(#body:empty) { min-height:190px; }
  .date-field { flex-wrap:wrap; gap:0 6px; }
}
@media(max-width:600px) {
  .top-inner,main { width: calc(100% - 28px); }
  .top-inner { min-height:55px; }
  .account span { display:none; }
  .account select { max-width:52vw; }
  form { grid-template-columns:1fr; gap:9px; }
  .date-field { justify-self:start; padding:5px 10px; }
  .primary span { display:none; }
  #date-hint { flex-basis:100%; margin:0; }
  .workspace > section { padding:14px 8px; }
  .searchbar { padding-left:12px; }
  #query { font-size:16px; }
}
