:root {
  --ink: #352415;
  --muted: #715d44;
  --line: #e9cd8c;
  --paper: #fff7e3;
  --white: #fffdf6;
  --dark: #352011;
  --gold: #d69a19;
  --soft: #fff0bc;
}

body {
  background: linear-gradient(180deg, #fff0bd 0, #fff8e8 255px, #fffaf0 100%);
}

.topbar {
  background: #352011;
  border-bottom: 4px solid #efba43;
}

.brand-mark {
  background: #f5c95a;
  border-color: #f5c95a;
  color: #38230e;
}

.brand-mark span { color: #38230e; }
.brand-text small { color: #e7c989; }
.text-button { color: #ffd778; }
.main { max-width: 1100px; padding-top: clamp(30px, 4vw, 54px); }
.eyebrow { color: #9a650f; }
.page-heading { margin-bottom: 24px; }

.card-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
}

.module-card {
  min-height: 100px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 28px;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  column-gap: 18px;
  background: #fff8e4;
  border-color: #ecca7e;
  border-radius: 15px;
  padding: 16px 24px;
  box-shadow: 0 4px 13px rgba(96, 59, 10, .04);
}

.module-card:nth-child(even) { background: #fffdf2; }

.module-card:hover {
  transform: translateX(4px);
  border-color: #d99d2a;
  background: #fff0bf;
  box-shadow: 0 9px 25px rgba(96, 59, 10, .12);
}

.module-number {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f7d981;
  color: #69430b;
  font-size: 14px;
}

.module-body {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.module-body strong { font-size: 20px; line-height: 1.25; }
.module-body small { font-size: 14px; line-height: 1.35; margin-top: 4px; }

.module-arrow {
  position: static;
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
  color: #a66d12;
  font-size: 25px;
}

.module-state {
  position: static;
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #ffe9aa;
  color: #76510e;
  font-size: 12px;
}

.unlinked { background: #fff9eb; }
.owner-card, .owner-card:nth-child(even) { background: #efc45b; border-color: #d6a532; color: #37230f; }
.owner-card .module-number { background: #fff0bb; color: #67420b; }
.owner-card .module-arrow, .owner-card .module-body small { color: #513916; }
.owner-card:hover { background: #f7d57c; }

.auth-card, .access-panel, .person { background: #fffdf5; border-color: #ebd39c; }
.primary { background: #dba62a; color: #33220d; border-color: #c69322; }
.primary:hover { background: #f0bd3d; }
.checks label { background: #fffaf0; border-color: #ecd8a5; }
.checks label:hover { background: #fff0c8; }
.checks input, .active-check input { accent-color: #b67c10; }

.settings-section {
  background: #fffdf5;
  border: 1px solid #ebd39c;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 14px;
}
.settings-section h2 { margin: 0 0 8px; font-size: 22px; }
.settings-section p { color: var(--muted); line-height: 1.5; margin: 0 0 17px; }
.settings-section ul { color: var(--muted); line-height: 1.65; margin-bottom: 0; padding-left: 22px; }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.settings-fields label { display: block; background: #fff7e6; border: 1px solid #eed9aa; border-radius: 10px; padding: 12px; }
.settings-fields input { max-width: 190px; }
.bot-settings-form > .primary { margin-top: 6px; }

/* Compact home: all navigation is visible without opening an extra menu. */
body:has(.quick-grid) .topbar { min-height: 64px; }
body:has(.quick-grid) .main { max-width: 920px; padding-top: 18px; padding-bottom: 4px; }
.compact-heading { margin-bottom: 14px; }
.compact-heading .eyebrow { margin-bottom: 4px; font-size: 10px; }
.compact-heading h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -.035em; }
.quick-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.quick-link {
  position: relative;
  min-width: 0;
  min-height: 42px;
  padding: 8px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(110deg, #fff9e7 0%, #ffe9ad 34%, #fff4d6 67%, #fffaf0 100%);
  background-size: 220% 100%;
  border: 1px solid #e8ca84;
  border-radius: 10px;
  color: #382714;
  text-decoration: none;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  box-shadow: 0 3px 10px rgba(96, 59, 10, .07);
  animation: warm-flow 15s ease-in-out infinite alternate;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.quick-link:nth-child(even) { animation-delay: -7s; background-image: linear-gradient(110deg, #fffdf2 0%, #ffe6c1 35%, #ffeeb8 68%, #fffaf0 100%); }
.quick-link > span:first-child { display: block; min-width: 0; width: 100%; text-align: center; }
.quick-link:hover { border-color: #d8a539; box-shadow: 0 6px 17px rgba(96, 59, 10, .14); transform: translateY(-1px); }
.quick-link:focus-visible { outline: 3px solid #bb831b; outline-offset: 2px; }
.quick-arrow { position: absolute; right: 14px; color: #a77015; font-size: 17px; font-weight: 400; }
.quick-unlinked { color: #776853; }
.quick-owner, .quick-owner:nth-child(even) { background-image: linear-gradient(110deg, #efc45b 0%, #ffe28b 45%, #eebc4c 100%); border-color: #d6a532; }
.quick-owner:hover { border-color: #b97e16; }
@keyframes warm-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) { .quick-link { animation: none; transition: none; } }

@media (max-width: 620px) {
  body:has(.quick-grid) .topbar { min-height: 46px; }
  body:has(.quick-grid) .brand-mark { width: 36px; height: 36px; font-size: 17px; }
  body:has(.quick-grid) .brand { gap: 8px; }
  body:has(.quick-grid) .brand-text { font-size: 14px; }
  body:has(.quick-grid) .brand-text small { display: none; }
  body:has(.quick-grid) .account { font-size: 12px; }
  body:has(.quick-grid) .account span { max-width: 58px; }
  body:has(.quick-grid) .text-button { padding: 6px 3px; font-size: 12px; }
  body:has(.quick-grid) .main { padding-top: 5px; padding-bottom: 0; }
  .compact-heading { margin-bottom: 6px; }
  .compact-heading h1 { font-size: 21px; }
  .quick-grid { gap: 4px; }
  .quick-link { min-height: 38px; padding: 6px 9px; font-size: 13px; border-radius: 8px; }
  .quick-arrow { display: none; }
  .settings-fields { grid-template-columns: 1fr; }
  .settings-section { padding: 18px; }
  .module-card {
    min-height: 94px;
    grid-template-columns: 42px minmax(0, 1fr) 22px;
    column-gap: 12px;
    padding: 14px 15px;
  }
  .module-number { width: 38px; height: 38px; border-radius: 10px; font-size: 12px; }
  .module-body strong { font-size: 17px; }
  .module-body small { font-size: 13px; }
  .module-arrow { font-size: 21px; }
  .module-state { font-size: 11px; }
}
