:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #181c20;
  --panel-2: #20262c;
  --text: #f1f5f7;
  --muted: #aab5be;
  --line: #313941;
  --accent: #62d6a6;
  --accent-2: #f5c96b;
  --danger: #ff7c7c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(98, 214, 166, 0.10), transparent 32%),
    linear-gradient(225deg, rgba(245, 201, 107, 0.08), transparent 34%),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.compact {
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 40px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 46px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  font-weight: 900;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.button.primary {
  border-color: rgba(98, 214, 166, 0.65);
  background: #193328;
  color: #c9ffe8;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 32px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  margin: 0 0 14px;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  margin: 22px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.terminal {
  border: 1px solid var(--line);
  background: rgba(24, 28, 32, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
}

.dot:nth-child(2) {
  background: var(--accent-2);
}

.dot:nth-child(3) {
  background: var(--accent);
}

pre {
  margin: 0;
  padding: 22px;
  color: #d7dee5;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

section,
.card {
  border: 1px solid var(--line);
  background: rgba(24, 28, 32, 0.86);
  padding: 22px;
}

h2 {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: 0;
}

p {
  margin: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.62;
}

.list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  display: grid;
  gap: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.list strong {
  color: var(--text);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 7px 10px;
  color: #d9e1e7;
  font-size: 13px;
  font-weight: 700;
}

.wide {
  grid-column: span 2;
}

.not-found {
  max-width: 720px;
}

footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
}

code {
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #d7dee5;
}

button {
  font: inherit;
  cursor: pointer;
}

.remote-shell {
  max-width: 920px;
}

.remote-shell header form {
  margin: 0;
}

.remote-panel,
.remote-login {
  padding: clamp(24px, 5vw, 48px);
  background: rgba(24, 28, 32, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.remote-login {
  width: min(520px, 100%);
  margin: 3vh auto 0;
}

.remote-title {
  font-size: clamp(32px, 6vw, 54px);
}

.remote-login-form {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

.remote-login-form input,
.remote-submit {
  min-height: 48px;
}

.remote-error {
  color: var(--danger);
  font-size: 14px;
}

.remote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.remote-target {
  display: grid;
  gap: 18px;
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  transition: border-color 150ms ease, transform 150ms ease;
}

.remote-target:hover,
.remote-target:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.remote-target-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.remote-target-top strong {
  font-size: 21px;
}

.remote-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.remote-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(98, 214, 166, 0.7);
}

.remote-enter {
  margin-top: auto;
  color: var(--accent);
  font-weight: 800;
}

select,
textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.queue-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wide-field {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
}

.jobs {
  margin-top: 16px;
}

.job-table {
  display: grid;
  gap: 8px;
}

.job-row {
  display: grid;
  grid-template-columns: 80px 110px minmax(180px, 0.8fr) 180px minmax(220px, 1.4fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(32, 38, 44, 0.76);
  padding: 10px 12px;
  color: var(--muted);
  overflow: hidden;
}

.job-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-row.head {
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-queued {
  color: var(--accent-2);
}

.status-running {
  color: #83c7ff;
}

.status-succeeded {
  color: var(--accent);
}

.status-failed,
.status-cancelled,
.warn {
  color: var(--danger);
}

.log {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #0d0f11;
}

.empty {
  padding: 8px 0;
}

.ai-page {
  color-scheme: light;
  --ai-bg: #f6f4ef;
  --ai-ink: #171a17;
  --ai-muted: #68706a;
  --ai-soft: #8a928b;
  --ai-line: #dfdbd2;
  --ai-line-strong: #c9c3b7;
  --ai-card: #fffdfa;
  --ai-card-2: #f0eee8;
  --ai-sidebar: #181b17;
  --ai-sidebar-2: #22261f;
  --ai-sidebar-line: #343a31;
  --ai-green: #137a52;
  --ai-green-soft: #e1f4eb;
  --ai-amber: #9b5e12;
  --ai-blue: #2966b8;
  --ai-red: #b42318;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 244, 239, 0)),
    var(--ai-bg);
  color: var(--ai-ink);
}

.ai-page .button {
  min-height: 38px;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: var(--ai-card);
  color: var(--ai-ink);
  box-shadow: 0 1px 1px rgba(23, 26, 23, 0.04);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.ai-page .button:hover {
  border-color: var(--ai-line-strong);
  background: #f8f6f1;
}

.ai-page .button:active {
  transform: translateY(1px);
}

.ai-page .button.primary {
  border-color: #0f6d49;
  background: var(--ai-green);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(19, 122, 82, 0.18);
}

.ai-page .button.primary:hover {
  background: #0f6d49;
}

.ai-page input,
.ai-page select,
.ai-page textarea {
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ai-ink);
  outline: none;
  box-shadow: 0 1px 0 rgba(23, 26, 23, 0.02);
}

.ai-page input:focus,
.ai-page select:focus,
.ai-page textarea:focus {
  border-color: rgba(19, 122, 82, 0.68);
  box-shadow: 0 0 0 3px rgba(19, 122, 82, 0.13);
}

.ai-page label {
  color: var(--ai-muted);
}

.ai-page pre,
.ai-page code {
  color: #2a302b;
}

.ai-page section {
  border-color: var(--ai-line);
  background: var(--ai-card);
}

.ai-shell {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  min-height: 100vh;
}

.ai-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--ai-sidebar-line);
  background:
    linear-gradient(180deg, rgba(43, 55, 45, 0.38), rgba(24, 27, 23, 0)),
    var(--ai-sidebar);
  padding: 18px;
  overflow: auto;
}

.ai-sidebar::-webkit-scrollbar,
.chat-surface::-webkit-scrollbar,
.log::-webkit-scrollbar {
  width: 10px;
}

.ai-sidebar::-webkit-scrollbar-thumb,
.chat-surface::-webkit-scrollbar-thumb,
.log::-webkit-scrollbar-thumb {
  background: rgba(104, 112, 106, 0.34);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.ai-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: #f5f3ed;
  font-weight: 900;
}

.ai-brand .mark {
  border-color: rgba(103, 216, 166, 0.42);
  border-radius: 8px;
  background: rgba(19, 122, 82, 0.16);
  color: #8ee0ba;
}

.ai-panel {
  border: 1px solid var(--ai-sidebar-line);
  border-radius: 8px;
  background: rgba(34, 38, 31, 0.92);
  padding: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.13);
}

.ai-panel.grow {
  flex: 1;
  min-height: 220px;
}

.ai-panel h2,
.mini-head h2 {
  margin: 0;
  font-size: 13px;
  color: #f5f3ed;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #aeb8ad;
  font-size: 12px;
}

.mini-head a {
  color: #8ee0ba;
  font-weight: 700;
}

.stack-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ai-sidebar label {
  color: #b9c1b8;
}

.ai-sidebar input,
.ai-sidebar select {
  border-color: #3b4238;
  background: #151914;
  color: #f4f2ec;
}

.ai-sidebar input::placeholder {
  color: #768074;
}

.ai-sidebar .button {
  border-color: #41483e;
  background: #272d25;
  color: #f4f2ec;
}

.ai-sidebar .button.primary {
  border-color: #59c997;
  background: #1f8a5f;
  color: #ffffff;
}

.compact-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #aeb8ad;
  font-size: 13px;
}

.compact-list strong {
  color: #f4f2ec;
  text-align: right;
}

.chat-list {
  display: grid;
  gap: 6px;
}

.chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #c0c8bf;
}

.chat-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item b {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border: 1px solid rgba(142, 224, 186, 0.48);
  border-radius: 999px;
  color: #8ee0ba;
  font-size: 12px;
}

.chat-item.active,
.chat-item:hover {
  border-color: #3f473c;
  background: #2a3027;
  color: #ffffff;
}

.ai-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 100vh;
}

.ai-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 0;
  padding: 24px 30px 20px;
  border-bottom: 1px solid var(--ai-line);
  background: rgba(255, 253, 250, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(23, 26, 23, 0.03);
}

.ai-topbar h1 {
  max-width: min(760px, 70vw);
  color: var(--ai-ink);
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.06;
}

.ai-topbar .eyebrow {
  color: var(--ai-green);
}

.pathline {
  margin-top: 9px;
  color: var(--ai-muted);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.chat-surface {
  border: 0;
  background:
    radial-gradient(circle at 22px 22px, rgba(23, 26, 23, 0.045) 1px, transparent 1px),
    var(--ai-bg);
  background-size: 28px 28px;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 30px;
  overflow: auto;
}

.message {
  display: grid;
  grid-template-columns: 42px minmax(0, 820px);
  gap: 12px;
  align-items: start;
}

.message.user {
  justify-content: end;
  grid-template-columns: minmax(0, 820px) 42px;
}

.message.user .avatar {
  grid-column: 2;
  background: #20372d;
  color: #a7e8c9;
}

.message.user .bubble {
  grid-column: 1;
  grid-row: 1;
  border-color: #b6dac8;
  background: #ecf8f2;
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ai-green);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(23, 26, 23, 0.07);
}

.bubble {
  min-width: 0;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.96);
  padding: 15px 16px;
  box-shadow: 0 10px 28px rgba(23, 26, 23, 0.06);
}

.bubble pre {
  padding: 0;
  background: transparent;
  color: var(--ai-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ai-muted);
  font-size: 12px;
}

.msg-meta strong {
  color: var(--ai-ink);
}

.msg-meta a {
  color: var(--ai-blue);
  font-weight: 800;
}

.empty-chat {
  margin: 8vh auto;
  max-width: 560px;
  padding: 34px;
  border: 1px dashed var(--ai-line-strong);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
  text-align: center;
}

.empty-chat h2 {
  color: var(--ai-ink);
}

.scheduler-panel {
  border-width: 1px 0 0;
  border-color: var(--ai-line);
  background: rgba(248, 246, 241, 0.96);
  padding: 18px 30px;
}

.scheduler-panel .mini-head,
.scheduler-panel .mini-head h2 {
  color: var(--ai-ink);
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.schedule-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--ai-line);
  border-left: 4px solid var(--ai-green);
  border-radius: 8px;
  background: #fffdfa;
  padding: 13px;
  box-shadow: 0 8px 22px rgba(23, 26, 23, 0.05);
}

.schedule-card.disabled {
  border-left-color: var(--ai-soft);
  opacity: 0.68;
}

.schedule-card p {
  margin: 7px 0;
  color: var(--ai-muted);
  overflow-wrap: anywhere;
}

.schedule-card small {
  color: var(--ai-soft);
}

.schedule-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.composer {
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--ai-line);
  background: rgba(255, 253, 250, 0.94);
  backdrop-filter: blur(16px);
  padding: 18px 30px 22px;
  box-shadow: 0 -12px 36px rgba(23, 26, 23, 0.08);
}

.composer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.composer-main textarea {
  min-height: 96px;
  border-color: var(--ai-line-strong);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(23, 26, 23, 0.03);
}

.composer-options {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 120px 100px 130px 130px;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.inline-check input {
  width: auto;
  accent-color: var(--ai-green);
}

.job-detail {
  border-width: 0 0 1px;
  border-color: var(--ai-line);
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  background: #fffdfa;
}

.job-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  flex: 1;
}

.job-facts span {
  display: grid;
  gap: 4px;
  color: var(--ai-muted);
}

.job-facts strong {
  color: var(--ai-ink);
}

.ai-page .log {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: #111411;
  color: #ecf3ea;
}

.ai-page .status {
  border-radius: 999px;
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.55);
}

.ai-page .status-queued {
  color: var(--ai-amber);
}

.ai-page .status-running {
  color: var(--ai-blue);
}

.ai-page .status-succeeded {
  color: var(--ai-green);
}

.ai-page .status-failed,
.ai-page .status-cancelled,
.ai-page .warn {
  color: var(--ai-red);
}

.memo-page {
  color-scheme: light;
  --memo-bg: #f5f4f0;
  --memo-ink: #1d201e;
  --memo-muted: #68706b;
  --memo-soft: #8d958f;
  --memo-line: #ded9cf;
  --memo-line-strong: #c7c1b6;
  --memo-card: #fffdfa;
  --memo-card-2: #eeebe3;
  --memo-green: #137a52;
  --memo-green-soft: #e3f3eb;
  --memo-blue: #2d66b3;
  --memo-red: #b42318;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(245, 244, 240, 0)),
    var(--memo-bg);
  color: var(--memo-ink);
}

.memo-shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 56px;
}

.memo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
}

.memo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--memo-ink);
  font-weight: 900;
}

.memo-brand .mark {
  border-color: rgba(19, 122, 82, 0.32);
  border-radius: 8px;
  background: var(--memo-green-soft);
  color: var(--memo-green);
}

.memo-page .button {
  min-height: 38px;
  border: 1px solid var(--memo-line);
  border-radius: 8px;
  background: var(--memo-card);
  color: var(--memo-ink);
  box-shadow: 0 1px 1px rgba(29, 32, 30, 0.04);
}

.memo-page .button:hover {
  border-color: var(--memo-line-strong);
  background: #f8f6f1;
}

.memo-page .button.primary {
  border-color: #0f6d49;
  background: var(--memo-green);
  color: #ffffff;
}

.memo-page input,
.memo-page textarea {
  border: 1px solid var(--memo-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--memo-ink);
  outline: none;
}

.memo-page input:focus,
.memo-page textarea:focus {
  border-color: rgba(19, 122, 82, 0.68);
  box-shadow: 0 0 0 3px rgba(19, 122, 82, 0.13);
}

.memo-page label {
  color: var(--memo-muted);
}

.memo-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.memo-hero .eyebrow {
  margin-bottom: 10px;
  color: var(--memo-green);
}

.memo-hero h1 {
  color: var(--memo-ink);
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1;
}

.memo-subtitle {
  margin-top: 14px;
  color: var(--memo-muted);
  font-size: 17px;
  line-height: 1.6;
}

.memo-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
  min-width: min(360px, 100%);
}

.memo-stats span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--memo-line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.86);
  padding: 12px;
  color: var(--memo-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.memo-stats strong {
  color: var(--memo-ink);
  font-size: 24px;
  line-height: 1;
}

.memo-controls {
  border: 1px solid var(--memo-line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 12px 32px rgba(29, 32, 30, 0.06);
}

.memo-compose {
  border: 0;
  background: transparent;
  padding: 0;
}

.memo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.flake-editor-card {
  display: grid;
  grid-template-rows: auto auto minmax(180px, auto) auto;
  min-height: 320px;
  border: 1px solid #2a2a45;
  border-radius: 8px;
  background: #0f0f1a;
  color: #e8e8f0;
  box-shadow: 0 16px 44px rgba(15, 15, 26, 0.24);
  overflow: hidden;
}

.memo-page .flake-title-input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #e8e8f0;
  padding: 18px 24px 12px;
  font-size: 24px;
  font-weight: 800;
  outline: none;
  box-shadow: none;
}

.memo-page .flake-title-input:focus {
  border-bottom-color: #6c63ff;
  box-shadow: none;
}

.memo-page .flake-title-input::placeholder,
.memo-page .flake-editor-input::placeholder {
  color: #6b6b80;
}

.flake-editor-rule {
  height: 1px;
  background: #2a2a45;
}

.rich-editor-wrap {
  display: flex;
  min-height: 246px;
  flex-direction: column;
}

.rich-editor-wrap.compact {
  min-height: 180px;
  border: 1px solid #2a2a45;
  border-radius: 8px;
  background: #0f0f1a;
  overflow: hidden;
}

.flake-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  border-bottom: 1px solid #2a2a45;
  padding: 6px 24px;
  flex-wrap: wrap;
}

.flake-editor-toolbar.compact {
  padding: 6px 10px;
}

.flake-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #a0a0b8;
  cursor: pointer;
  font: 14px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.flake-toolbar-btn:hover {
  background: #1f2b47;
  color: #e8e8f0;
}

.flake-toolbar-btn:active {
  background: #6c63ff;
  color: #ffffff;
}

.flake-toolbar-divider {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: #2a2a45;
}

.memo-page .flake-toolbar-select {
  width: auto;
  min-height: 34px;
  border: 1px solid #2a2a45;
  border-radius: 6px;
  background: #16213e;
  color: #a0a0b8;
  padding: 0 8px;
  font-size: 12px;
}

.memo-page .flake-editor-input {
  width: 100%;
  flex: 1;
  min-height: 210px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e8e8f0;
  padding: 20px 24px;
  font-size: 15px;
  line-height: 1.8;
  outline: none;
  overflow-y: auto;
  box-shadow: none;
}

.memo-page .flake-editor-input.compact {
  min-height: 120px;
  padding: 14px 16px;
}

.memo-page .flake-editor-input:focus {
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.22);
}

.memo-page .flake-editor-input:empty::before {
  content: attr(data-placeholder);
  color: #6b6b80;
  pointer-events: none;
}

.memo-page .flake-editor-input img,
.rich-note img {
  display: block;
  max-width: 100%;
  border: 1px solid rgba(108, 99, 255, 0.22);
  border-radius: 8px;
  margin: 12px 0;
}

.memo-page .flake-editor-input pre,
.rich-note pre {
  border: 1px solid #2a2a45;
  border-radius: 8px;
  background: #0d1117;
  color: #e6edf3;
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.memo-page .flake-editor-input code,
.rich-note code {
  color: inherit;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.flake-editor-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  border-top: 1px solid #2a2a45;
  padding: 8px 24px;
  color: #6b6b80;
  font-size: 12px;
}

.memo-submit {
  min-width: 86px;
  align-self: end;
}

.memo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px;
}

.memo-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.memo-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--memo-muted);
  font-weight: 800;
}

.memo-tabs a.active,
.memo-tabs a:hover {
  border-color: var(--memo-line);
  background: var(--memo-green-soft);
  color: var(--memo-green);
}

.memo-tabs span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(19, 122, 82, 0.12);
  font-size: 12px;
}

.memo-search {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto auto;
  gap: 8px;
  align-items: center;
}

.memo-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 0;
  background: transparent;
  padding: 0;
}

.memo-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--memo-line);
  border-radius: 8px;
  background: var(--memo-card);
  padding: 14px;
  box-shadow: 0 10px 26px rgba(29, 32, 30, 0.05);
}

.memo-item.done {
  background: #f2f0ea;
}

.memo-toggle {
  display: grid;
  place-items: center;
  width: 58px;
  min-height: 36px;
  border: 1px solid var(--memo-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--memo-muted);
  font: 12px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 900;
  cursor: pointer;
}

.memo-item.done .memo-toggle {
  border-color: rgba(19, 122, 82, 0.34);
  background: var(--memo-green-soft);
  color: var(--memo-green);
}

.memo-body {
  min-width: 0;
}

.memo-title {
  margin: 0;
  color: var(--memo-ink);
  font-size: 18px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.memo-item.done .memo-title {
  color: var(--memo-soft);
  text-decoration: line-through;
}

.memo-notes {
  margin-top: 7px;
  color: var(--memo-muted);
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.rich-note {
  display: grid;
  gap: 8px;
}

.rich-note p,
.rich-note div,
.rich-note ul,
.rich-note ol,
.rich-note pre {
  margin: 0;
}

.rich-note ul,
.rich-note ol {
  padding-left: 20px;
}

.rich-note pre,
.rich-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.rich-note a {
  color: var(--memo-blue);
  font-weight: 800;
}

.memo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--memo-soft);
  font-size: 12px;
}

.memo-assist {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #d9e2ec;
  border-left: 4px solid var(--memo-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #f6f8fb);
  padding: 12px;
  box-shadow: 0 8px 22px rgba(45, 102, 179, 0.05);
}

.memo-assist.queued,
.memo-assist.running {
  border-left-color: var(--memo-blue);
}

.memo-assist.succeeded {
  border-left-color: var(--memo-green);
}

.memo-assist.failed {
  border-left-color: var(--memo-red);
}

.memo-assist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memo-assist-head div {
  display: grid;
  gap: 3px;
}

.memo-assist-head strong {
  color: var(--memo-ink);
}

.memo-assist-head small {
  color: #8a96a3;
}

.memo-assist-head span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--memo-line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--memo-muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.memo-assist pre {
  padding: 0;
  color: var(--memo-ink);
  background: transparent;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.memo-assist small,
.memo-assist-muted {
  color: var(--memo-soft);
  line-height: 1.55;
}

.memo-assist-error {
  color: var(--memo-red);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.memo-assist form {
  justify-self: start;
}

.memo-assist-loading {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 28px;
}

.memo-assist-loading i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--memo-blue);
  animation: assist-pulse 900ms ease-in-out infinite;
}

.memo-assist-loading i:nth-child(2) {
  animation-delay: 120ms;
}

.memo-assist-loading i:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes assist-pulse {
  0%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.memo-editor {
  margin-top: 12px;
  border-top: 1px solid var(--memo-line);
  padding-top: 10px;
}

.memo-editor summary {
  width: fit-content;
  color: var(--memo-blue);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.memo-edit-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.memo-edit-form .button {
  justify-self: start;
}

.memo-delete .button {
  color: var(--memo-red);
}

.memo-empty {
  border: 1px dashed var(--memo-line-strong);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.68);
  padding: 34px;
  text-align: center;
}

.memo-empty h2 {
  color: var(--memo-ink);
}

.memo-empty p {
  margin-top: 8px;
  color: var(--memo-muted);
}

.memo-clear {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

@media (max-width: 860px) {
  header,
  .hero {
    grid-template-columns: 1fr;
  }

  header {
    align-items: flex-start;
  }

  nav {
    justify-content: flex-start;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }

  .queue-form,
  .job-row {
    grid-template-columns: 1fr;
  }

  .ai-shell {
    grid-template-columns: 1fr;
  }

  .ai-sidebar {
    position: static;
    height: auto;
  }

  .ai-topbar,
  .composer-main,
  .schedule-card,
  .job-detail {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .composer-options {
    grid-template-columns: 1fr;
  }

  .message,
  .message.user {
    grid-template-columns: 1fr;
  }

  .message .avatar,
  .message.user .avatar {
    display: none;
  }

  .message.user .bubble {
    grid-column: auto;
  }

  .memo-hero,
  .memo-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .memo-form,
  .memo-search,
  .memo-item {
    grid-template-columns: 1fr;
  }

  .memo-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .memo-tabs {
    overflow-x: auto;
  }

  .memo-delete .button {
    width: 100%;
  }

  .remote-grid {
    grid-template-columns: 1fr;
  }
}
