:root {
  color-scheme: dark;
  --bg: #101216;
  --side: #191c21;
  --panel: #22262d;
  --input: #191c21;
  --text: #f5f4ef;
  --muted: #a0a5ae;
  --line: #383b40;
  --accent: #d5a34d;
  --ink: #201b12;
  --sheet: #191c20;
  --draw: #b9b7a8;
  --shadow: 0 28px 90px #0006;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f7f4;
  --side: #eeede8;
  --panel: #fff;
  --input: #faf9f6;
  --text: #252728;
  --muted: #575e65;
  --line: #cecdc6;
  --accent: #bd892e;
  --sheet: #deded5;
  --draw: #51554e;
  --shadow: 0 28px 90px #302f2422;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    1rem/1.5 "Inter",
    "Segoe UI",
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
select,
input,
textarea {
  border-radius: 7px;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.58rem 0.95rem;
}
button:hover {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button svg,
span[data-icon] svg {
  display: block;
  width: 1.17rem;
  height: 1.17rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
input,
select,
textarea {
  width: 100%;
  padding: 0.77rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
label {
  display: block;
  margin: 1.05rem 0 0.4rem;
  font-size: 0.89rem;
  font-weight: 600;
}
textarea {
  resize: vertical;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  letter-spacing: -0.05em;
  font-weight: 600;
}
.mast {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1.2rem, 4.3vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.35rem;
  letter-spacing: -0.06em;
  font-weight: 680;
  text-decoration: none;
}
.brand svg {
  width: 35px;
  height: 35px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.35;
  stroke-linejoin: round;
}
.mast-tools,
.dialog-actions,
.dialog-head,
.tools,
.pager,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.product {
  font-size: 0.88rem;
  color: var(--muted);
  padding-right: 0.9rem;
  border-right: 1px solid var(--line);
}
.icon {
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  flex-shrink: 0;
  background: transparent;
}
.theme {
  border: 0;
}
.login-grid {
  display: grid;
  grid-template-columns: 1.14fr 1fr;
  min-height: calc(100svh - 74px);
}
.drawing {
  position: relative;
  overflow: hidden;
  background: var(--sheet);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 4.8vw, 6rem);
  isolation: isolate;
}
.drawing:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(
      to right,
      color-mix(in srgb, var(--draw) 6%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--draw) 6%, transparent) 1px,
      transparent 1px
    );
  background-size: 32px 32px;
  z-index: -1;
}
.board {
  position: relative;
  min-height: 270px;
  flex: 1;
  display: flex;
  align-items: center;
}
.board canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.board-top,
.board-foot {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font:
    0.7rem/1.2 "Courier New",
    monospace;
  letter-spacing: 0.15em;
}
.board-top {
  top: 0;
}
.board-foot {
  bottom: 0;
}
.cross {
  font-size: 1.18rem;
  font-weight: 400;
  color: var(--accent);
}
.board-rule,
.gold-line {
  height: 1px;
  background: var(--line);
  flex: 1;
}
.gold-line {
  flex: none;
  width: 2.2rem;
  background: var(--accent);
}
.drawing-caption {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2rem;
}
.drawing h1 {
  margin-top: 0.6rem;
  letter-spacing: -0.075em;
  font-weight: 540;
  line-height: 0.96;
  font-size: clamp(3.2rem, 5.9vw, 6.7rem);
}
.drawing h1 em {
  font-family: Georgia, serif;
  font-weight: normal;
  color: var(--accent);
  letter-spacing: -0.068em;
}
.access {
  display: grid;
  place-items: center;
  padding: 3rem clamp(1.35rem, 5vw, 7rem);
}
.form-wrap {
  width: 100%;
  max-width: 25rem;
}
.access-symbol {
  display: inline-flex;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 11px;
  padding: 0.75rem;
  margin-bottom: 1.05rem;
}
#login-desc,
.muted {
  color: var(--muted);
}
#login-desc {
  margin: 0.35rem 0 1.5rem;
}
.password {
  position: relative;
}
.password input {
  padding-right: 3.2rem;
}
.password .icon {
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  color: var(--muted);
}
.full {
  width: 100%;
}
.primary {
  color: var(--ink);
  background: var(--accent);
  border: 1px solid transparent;
  font-weight: 650;
}
.primary:hover {
  filter: brightness(1.08);
}
#auth .primary {
  margin-top: 1.4rem;
  padding: 0.8rem;
}
#auth-extra {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.7rem;
}
#auth-extra a,
.aux-link {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}
.notice {
  margin-top: 0.6rem;
  color: var(--muted);
  white-space: pre-wrap;
}
.notice:empty {
  display: none;
}
.shell {
  display: grid;
  grid-template-columns: minmax(185px, 240px) 1fr;
  min-height: calc(100svh - 74px);
}
aside {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 1.4rem 1rem;
}
aside label {
  margin-top: 0;
}
aside select {
  margin-bottom: 0.8rem;
}
nav {
  margin-top: 1rem;
}
nav button,
.nav-link {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  margin: 0.12rem 0;
  text-align: left;
  color: var(--muted);
  padding: 0.62rem 0.72rem;
  overflow-wrap: anywhere;
  text-decoration: none;
}
nav button[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
#nav-extra {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}
.mail-content {
  min-width: 0;
  padding: clamp(1rem, 3.5vw, 4rem);
}
.tools {
  margin-bottom: 2rem;
}
.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 0.8rem;
  background: var(--input);
  margin: 0;
  flex: 1;
}
.search input {
  border: 0;
  background: transparent;
}
.dialog-head,
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.list {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
.message-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.2rem;
}
.message-row input,
.inline-actions input[type="checkbox"] {
  width: 1rem;
}
.message-row button {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) minmax(8rem, 2fr) auto;
  gap: 0.85rem;
  text-align: left;
  padding: 0.2rem 0.3rem;
  background: transparent;
  border: 0;
}
.message-row button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-row.unread button {
  font-weight: 700;
}
.message-row time,
.meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.inline-actions {
  flex-wrap: wrap;
  margin: 0.85rem 0;
}
.inline-actions button,
.pager button {
  font-size: 0.86rem;
  padding: 0.45rem 0.65rem;
}
.inline-actions select {
  width: auto;
  max-width: 100%;
  padding: 0.45rem 0.65rem;
}
.empty {
  padding: 3.4rem 1rem;
  text-align: center;
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 1rem;
}
.pager {
  justify-content: flex-end;
  margin-top: 1rem;
}
.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 1.5rem 0;
}
.message-frame {
  background: white;
  width: 100%;
  height: 24rem;
  border: 0;
}
.warning {
  padding: 0.7rem 1rem;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-left: 2px solid var(--accent);
  margin: 0.9rem 0;
}
.attachment {
  display: block;
  margin: 0.5rem 0;
  color: var(--accent);
}
dialog {
  width: min(95vw, 42rem);
  max-height: 92svh;
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--side);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #080a0dc9;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.dialog-actions {
  justify-content: flex-end;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
.dialog-head h2 {
  font-size: 1.55rem;
}
.dialog-head .icon {
  border: 0;
}
#mobile-nav {
  display: none;
}
@media (min-width: 1450px) {
  .drawing {
    padding-inline: max(4vw, calc((100vw - 1300px) / 3));
  }
}
@media (max-width: 760px) {
  .mast {
    height: 60px;
  }
  .login-grid {
    grid-template-columns: 1fr;
    min-height: calc(100svh - 60px);
  }
  .drawing {
    min-height: 150px;
    padding: 1.45rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .board {
    position: absolute;
    inset: 0.65rem 0 0.65rem 44%;
    min-height: 0;
  }
  .board-top,
  .board-foot {
    display: none;
  }
  .drawing-caption {
    margin: 0;
  }
  .drawing h1 {
    font-size: 2.8rem;
  }
  .access {
    padding: 1.7rem 1.25rem;
    align-items: start;
  }
  .form-wrap {
    max-width: 31rem;
  }
  .access-symbol {
    display: none;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .shell aside {
    display: none;
  }
  .shell aside.open {
    display: block;
    border-bottom: 1px solid var(--line);
  }
  #mobile-nav {
    display: flex;
    margin: 1rem 1rem 0;
  }
  .message-row button {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.1rem 0.5rem;
  }
  .message-row button span:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .message-row button time {
    grid-column: 2;
    grid-row: 1;
  }
  .tools {
    margin-bottom: 1rem;
  }
  .product {
    display: none;
  }
}
.filters {
  margin: -0.7rem 0 1.1rem;
  border: 1px solid var(--line);
  background: var(--side);
  padding: 0.8rem 1rem 1rem;
  border-radius: 8px;
  align-items: end;
}
.filters label {
  margin: 0;
}
.filters input:not([type="checkbox"]) {
  display: block;
  margin-top: 0.3rem;
}
.filters input[type="checkbox"] {
  width: auto;
}
.mail-content h2 {
  overflow-wrap: anywhere;
}
.mail-content #view > button:first-child {
  margin-bottom: 1rem;
}
.nav-link {
  font-size: 0.9rem;
}
.board-top,
.board-foot {
  pointer-events: none;
}
.nav-link:focus-visible {
  outline-offset: 0;
}
.template-group {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.template-group summary {
  cursor: pointer;
}
.template-group select,
.template-group button {
  margin-top: 0.55rem;
}
.scheduled-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.scheduled-row button {
  margin-left: auto;
}
.rule-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin: 0.7rem 0;
  padding: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.rule-row button {
  justify-self: end;
}
dialog h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.65rem;
}
.image-preview {
  margin: 0.5rem 0;
}
.image-preview summary {
  cursor: pointer;
  color: var(--muted);
}
.image-preview img {
  display: block;
  max-width: 100%;
  max-height: min(60vh, 600px);
  object-fit: contain;
  margin: 0.7rem 0;
}
.remote-image {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  margin: 0.75rem 0;
}
@media (max-width: 600px) {
  .mast {
    padding-inline: 1rem;
    gap: 0.4rem;
  }
  .mast-tools {
    gap: 0.2rem;
  }
  .mast-tools .icon {
    width: 2.1rem;
    height: 2.3rem;
  }
  .mast-tools #logout {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
  .brand {
    gap: 0.35rem;
  }
  .brand svg {
    width: 30px;
    height: 30px;
  }
}
