:root {
  --ink: #211f1c;
  --ink-soft: #3f3a35;
  --muted: #68615a;
  --faint: #817970;
  --canvas: #f6f3ef;
  --canvas-deep: #eee9e2;
  --surface: #fffdf9;
  --surface-raised: #ffffff;
  --surface-tint: #f2eee8;
  --line: #ddd5cc;
  --line-strong: #bdb3a8;
  --accent: #9e3d2d;
  --accent-dark: #782b20;
  --accent-soft: #f6ded5;
  --evergreen: #285c54;
  --evergreen-dark: #1d4741;
  --evergreen-soft: #dfece8;
  --warm: #9a6536;
  --warm-soft: #f4e7d5;
  --private: #66507f;
  --private-soft: #eee8f5;
  --danger: #a32929;
  --danger-soft: #f8dfdc;
  --focus: #0f6f9a;
  --sidebar: #2b2825;
  --sidebar-soft: #37322e;
  --sidebar-text: #f7f1e9;
  --shadow-sm: 0 1px 2px rgba(45, 37, 30, 0.07), 0 6px 18px rgba(45, 37, 30, 0.04);
  --shadow-md: 0 2px 4px rgba(45, 37, 30, 0.08), 0 18px 42px rgba(45, 37, 30, 0.08);
  --shadow-lg: 0 28px 80px rgba(45, 37, 30, 0.18);
  --radius: 18px;
  --small-radius: 11px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 8%, rgba(158, 61, 45, 0.035), transparent 28rem),
    linear-gradient(145deg, var(--canvas) 0%, #f8f6f2 55%, var(--canvas-deep) 140%);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: var(--evergreen-dark);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  color: #fff;
  background: var(--accent);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  color: #fff;
  background: var(--focus);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  transform: translateY(0);
}

.line-icon {
  width: 1.18rem;
  height: 1.18rem;
  flex: 0 0 auto;
}

.compass-mark {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
}

.brand-monogram-c,
.brand-monogram-p,
.brand-monogram-s {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-monogram-c {
  stroke: currentColor;
  stroke-dasharray: 215;
  stroke-width: 7;
  animation: monogram-draw 1.1s ease-out both;
}

.brand-monogram-p {
  stroke: var(--accent);
  stroke-width: 7;
}

.brand-monogram-north {
  fill: var(--accent);
}

.brand-monogram-s {
  stroke: var(--evergreen);
  stroke-dasharray: 80;
  stroke-width: 6;
  animation: monogram-draw 0.9s ease-out 0.35s both;
}

@keyframes monogram-draw {
  from {
    stroke-dashoffset: 215;
  }

  to {
    stroke-dashoffset: 0;
  }
}

.loading-shell,
.login-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  place-items: center;
  padding: 1.5rem;
}

.login-shell::before,
.login-shell::after {
  position: fixed;
  z-index: -1;
  border-radius: 45% 55% 58% 42%;
  content: "";
  pointer-events: none;
}

.login-shell::before {
  top: -10rem;
  right: -7rem;
  width: 31rem;
  height: 26rem;
  transform: rotate(18deg);
  background:
    radial-gradient(circle at 34% 42%, rgba(255, 255, 255, 0.64) 0 2px, transparent 3px),
    linear-gradient(145deg, rgba(158, 61, 45, 0.2), rgba(180, 114, 72, 0.08));
  background-size: 18px 18px, auto;
}

.login-shell::after {
  bottom: -14rem;
  left: -8rem;
  width: 34rem;
  height: 29rem;
  transform: rotate(-14deg);
  background: linear-gradient(145deg, rgba(40, 92, 84, 0.17), rgba(40, 92, 84, 0.03));
}

.login-card {
  position: relative;
  width: min(100%, 510px);
  padding: clamp(1.75rem, 5vw, 3.35rem);
  overflow: hidden;
  border: 1px solid rgba(189, 179, 168, 0.78);
  border-radius: 28px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: var(--shadow-lg);
}

.login-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 7.5rem;
  height: 0.34rem;
  border-radius: 0 0 999px;
  background: linear-gradient(90deg, var(--accent), #d17852);
  content: "";
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 8.7rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  color: inherit;
  font-size: 1.05rem;
  font-weight: 780;
  line-height: 1;
}

.brand-letter {
  text-align: center;
}

.brand-letter-anchor {
  color: #d9825d;
  font-weight: 900;
  transform: scale(1.12);
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.brand-mantra {
  display: flex;
  width: 9.2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.66rem;
  white-space: nowrap;
}

.brand-mantra span + span::before {
  margin: 0 0.28rem;
  color: rgba(217, 204, 192, 0.65);
  content: "·";
}

.brand-mantra strong {
  color: #e49470;
  font-weight: 850;
}

.login-card .brand-lockup {
  color: var(--evergreen-dark);
}

.login-card h1,
.page-heading h1 {
  margin: 1.6rem 0 0.55rem;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 710;
  line-height: 1.08;
  letter-spacing: -0.048em;
}

.login-card > p {
  max-width: 35rem;
  margin: 0 0 1.65rem;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 0.9rem;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
  flex-direction: column;
  padding: 1.4rem 1rem 1rem;
  color: var(--sidebar-text);
  background:
    radial-gradient(circle at 16% 5%, rgba(200, 105, 73, 0.2), transparent 16rem),
    linear-gradient(175deg, var(--sidebar-soft), var(--sidebar) 58%);
}

.sidebar::after {
  position: absolute;
  right: -4.5rem;
  bottom: 5.5rem;
  width: 10rem;
  height: 15rem;
  transform: rotate(22deg);
  border: 1px solid rgba(247, 241, 233, 0.07);
  border-radius: 46% 54% 38% 62%;
  content: "";
  pointer-events: none;
}

.sidebar .brand-lockup {
  margin: 0 0.1rem 0.25rem;
  padding: 0.85rem 0.8rem 1rem;
  border: 1px solid rgba(247, 241, 233, 0.14);
  border-radius: 16px;
  color: var(--sidebar-text);
  background:
    radial-gradient(circle at 12% 10%, rgba(212, 122, 76, 0.24), transparent 7rem),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar .brand-compass {
  width: 3.15rem;
  height: 3.15rem;
  padding: 0.26rem;
  border: 1px solid rgba(244, 180, 137, 0.34);
  border-radius: 12px;
  color: #f7f1e9;
  background: rgba(158, 61, 45, 0.28);
}

.sidebar .brand-mark {
  font-size: 1.08rem;
}

.sidebar .brand-subtitle {
  color: #d9ccc0;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.sidebar .brand-monogram-p,
.sidebar .brand-monogram-north {
  stroke: #ec8d67;
}

.sidebar .brand-monogram-north {
  fill: #ec8d67;
}

.sidebar .brand-monogram-s {
  stroke: #77a99f;
}

.sidebar nav {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  padding: 0.35rem 0.18rem 1rem 0;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

.nav-group + .nav-group {
  margin-top: 1.2rem;
}

.nav-group-label {
  display: block;
  margin: 0 0.68rem 0.42rem;
  color: #aca096;
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  width: 100%;
  min-height: 2.55rem;
  align-items: center;
  justify-content: flex-start;
  gap: 0.72rem;
  padding: 0.56rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #e4dcd3;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 540;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-link .line-icon {
  color: #b9aaa0;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.nav-link[aria-current="page"] {
  color: #351c16;
  background: linear-gradient(135deg, #f7e3d9, #efd1c2);
  box-shadow: 0 8px 20px rgba(8, 5, 3, 0.16);
  font-weight: 690;
}

.nav-link[aria-current="page"] .line-icon {
  color: var(--accent);
}

.sidebar-bottom {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 1rem 0.48rem 0;
  border-top: 1px solid rgba(247, 241, 233, 0.12);
}

.identity-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.identity-card > div {
  display: grid;
  min-width: 0;
}

.identity-card strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-card span:not(.identity-avatar) {
  color: #bdb1a7;
  font-size: 0.72rem;
}

.identity-avatar {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #fff;
  background: rgba(158, 61, 45, 0.75);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.sidebar-bottom .button-quiet {
  color: #e7ddd5;
}

.sidebar-bottom .button-quiet:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.main-column {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(1.1rem, 4vw, 3.25rem);
  border-bottom: 1px solid rgba(221, 213, 204, 0.8);
  background: rgba(246, 243, 239, 0.88);
  backdrop-filter: blur(16px);
}

.topbar-context {
  color: var(--muted);
  font-size: 0.84rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.storage-badge {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  gap: 0.42rem;
  padding: 0.3rem 0.68rem;
  border: 1px solid #cddbd6;
  border-radius: 999px;
  color: var(--evergreen-dark);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.73rem;
  font-weight: 650;
}

.storage-badge .line-icon {
  width: 0.98rem;
  height: 0.98rem;
}

.main-content {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.25rem);
}

.page-heading {
  position: relative;
  display: flex;
  max-width: 940px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.1rem;
}

.page-heading::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 4.5rem;
  height: 0.25rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #d3865c);
  content: "";
}

.page-heading-copy {
  max-width: 790px;
}

.page-heading h1 {
  margin-top: 0;
}

.page-heading-copy > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 1.01rem;
  line-height: 1.55;
}

.page-heading-illustration {
  position: relative;
  width: 13rem;
  height: 7.5rem;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(189, 179, 168, 0.72);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 14%, rgba(154, 101, 54, 0.12), transparent 4rem),
    linear-gradient(145deg, rgba(255, 253, 249, 0.94), rgba(242, 238, 232, 0.9));
  box-shadow: var(--shadow-sm);
}

.mentorship-illustration {
  display: block;
  width: 100%;
  height: 100%;
}

.mentorship-up-link {
  stroke: var(--line-strong);
  stroke-dasharray: 3 4;
  stroke-linecap: round;
  stroke-width: 1.25;
}

.mentorship-guide-base {
  fill: none;
  stroke: rgba(40, 92, 84, 0.13);
  stroke-linecap: round;
  stroke-width: 7;
}

.mentorship-guide {
  fill: none;
  stroke: var(--evergreen);
  stroke-dasharray: 170;
  stroke-dashoffset: 170;
  stroke-linecap: round;
  stroke-width: 2.5;
  animation: mentorship-draw 1.4s ease-out 0.25s both;
}

.mentorship-goal-ring {
  fill: var(--warm-soft);
  stroke: var(--warm);
  stroke-width: 1.5;
}

.mentorship-north {
  fill: var(--warm);
  font-family: inherit;
  font-size: 7px;
  font-weight: 800;
}

.mentorship-needle {
  fill: var(--accent);
}

.mentorship-node-halo {
  fill: var(--surface-raised);
  stroke-width: 1.5;
}

.mentorship-node-core {
  stroke: var(--surface-raised);
  stroke-width: 3;
}

.mentorship-mentor .mentorship-node-halo {
  stroke: rgba(158, 61, 45, 0.25);
}

.mentorship-mentor .mentorship-node-core {
  fill: var(--accent);
}

.mentorship-mentee .mentorship-node-halo {
  stroke: rgba(40, 92, 84, 0.25);
}

.mentorship-mentee .mentorship-node-core {
  fill: var(--evergreen);
}

.mentorship-label {
  fill: var(--muted);
  font-family: inherit;
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

@keyframes mentorship-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-message {
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #c8dcd6;
  border-radius: var(--small-radius);
  color: var(--evergreen-dark);
  background: var(--evergreen-soft);
  font-size: 0.88rem;
  font-weight: 620;
}

.error-message,
.error-summary {
  margin: 0 0 1rem;
  padding: 0.82rem 0.95rem;
  border-left: 4px solid var(--danger);
  border-radius: 0 var(--small-radius) var(--small-radius) 0;
  color: #70211d;
  background: var(--danger-soft);
}

.notice,
.boundary-note,
.private-note,
.security-note {
  position: relative;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-tint);
}

.boundary-note {
  overflow: hidden;
  border-color: #cbdcd6;
  color: #29453f;
  background: linear-gradient(135deg, #edf5f2, #f9f7f2);
}

.boundary-note::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0.3rem;
  background: var(--evergreen);
  content: "";
}

.private-note {
  border-color: #d8cdf4;
  color: #443176;
  background: var(--private-soft);
}

.security-note {
  border-color: #e8d0b3;
  color: #70461d;
  background: var(--warm-soft);
}

.notice p,
.boundary-note p,
.private-note p,
.security-note p {
  margin: 0;
}

.notice strong,
.boundary-note strong,
.private-note strong,
.security-note strong {
  color: inherit;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.button,
.button-secondary,
.button-danger,
.button-quiet {
  min-height: 2.7rem;
  padding: 0.62rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 680;
  line-height: 1.25;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.button {
  color: #fff;
  background: linear-gradient(135deg, #a94331, var(--accent));
  box-shadow: 0 5px 14px rgba(120, 43, 32, 0.18);
}

.button:hover {
  background: var(--accent-dark);
  box-shadow: 0 7px 18px rgba(120, 43, 32, 0.24);
  transform: translateY(-1px);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 1px 1px rgba(45, 37, 30, 0.04);
}

.button-secondary:hover {
  border-color: #978d82;
  background: #fff;
  transform: translateY(-1px);
}

.button-danger {
  border-color: #d59c95;
  color: #832c24;
  background: var(--surface);
}

.button-danger:hover {
  background: var(--danger-soft);
}

.button-quiet {
  min-height: 2.3rem;
  padding: 0.4rem 0.55rem;
  color: var(--evergreen-dark);
  background: transparent;
}

.button-quiet:hover {
  color: #173b36;
  background: var(--evergreen-soft);
}

.icon-button {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  padding: 0;
}

.panel,
.record-card,
.overview-card,
.form-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow-sm);
}

.panel,
.form-panel {
  padding: clamp(1.1rem, 3vw, 1.55rem);
}

.panel + .panel,
.panel + .form-panel,
.form-panel + .panel,
.form-panel + .form-panel {
  margin-top: 1.35rem;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.form-panel h2,
.panel h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-heading p,
.form-panel > p,
.panel > p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.05rem;
}

.overview-card {
  position: relative;
  min-height: 172px;
  overflow: hidden;
  padding: 1.3rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.overview-card::before {
  position: absolute;
  top: 0;
  left: 1.3rem;
  width: 3.2rem;
  height: 0.24rem;
  border-radius: 0 0 999px 999px;
  background: var(--accent);
  content: "";
}

.overview-card:nth-child(2)::before,
.overview-card:nth-child(4)::before,
.overview-card:nth-child(6)::before {
  background: var(--evergreen);
}

.overview-card:nth-child(3)::before,
.overview-card:nth-child(7)::before {
  background: var(--warm);
}

.overview-card:hover {
  border-color: #c9beb3;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.overview-card.wide {
  grid-column: span 7;
}

.overview-card.medium {
  grid-column: span 5;
}

.overview-card.third {
  grid-column: span 4;
}

.overview-card h2 {
  margin: 0.15rem 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 710;
  letter-spacing: -0.015em;
}

.overview-card p {
  margin: 0;
  color: var(--muted);
}

.overview-card .button-quiet {
  margin-top: 0.65rem;
}

.focus-history {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.focus-history h3 {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.focus-history ol {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.15rem;
}

.focus-history li {
  color: var(--muted);
}

.focus-history span {
  display: block;
}

.focus-history small {
  display: block;
  margin-top: 0.08rem;
  color: var(--faint);
  font-size: 0.74rem;
}

.quote-prompt {
  display: -webkit-box;
  max-height: 5.9em;
  overflow: hidden;
  color: var(--accent-dark) !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.16rem, 1.35vw, 1.38rem);
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.reflection-prompt-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.reflection-prompt-card .button-quiet {
  align-self: end;
  justify-self: start;
}

.mentor-panel,
.mentor-preparation-card {
  background:
    linear-gradient(135deg, rgba(25, 92, 82, 0.08), rgba(255, 252, 247, 0.94) 56%),
    var(--surface);
}

.mentor-panel {
  border-color: #b8d1ca;
}

.mentor-preparation-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.mentor-prompt-group {
  margin-top: 0.8rem;
}

.mentor-prompt-group h3 {
  margin: 0 0 0.36rem;
  color: var(--evergreen);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mentor-prompt-group ul {
  display: grid;
  gap: 0.38rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.mentor-prompt-group li::marker {
  color: var(--evergreen);
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.record-list {
  display: grid;
  gap: 0.8rem;
}

.record-card {
  position: relative;
  padding: 1.15rem;
  overflow: hidden;
  background: linear-gradient(145deg, var(--surface-raised), var(--surface) 78%);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.record-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0.24rem;
  background: var(--evergreen);
  content: "";
}

.record-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.record-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.record-card p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.record-meta {
  margin-top: 0.75rem !important;
  color: var(--faint) !important;
  font-size: 0.78rem;
}

.record-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.16rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-tint);
  font-size: 0.74rem;
  font-weight: 700;
}

.pill.shared {
  border-color: #adcfc5;
  color: var(--evergreen-dark);
  background: var(--evergreen-soft);
}

.pill.private {
  border-color: #d8cdf4;
  color: var(--private);
  background: var(--private-soft);
}

.pill.warm {
  border-color: #ead1af;
  color: #764914;
  background: var(--warm-soft);
}

.empty-state {
  position: relative;
  padding: 1.1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--small-radius);
  color: var(--muted);
  background:
    radial-gradient(circle, rgba(40, 92, 84, 0.11) 0 1px, transparent 1.5px) 0 0 / 16px 16px,
    linear-gradient(145deg, rgba(223, 236, 232, 0.46), rgba(255, 253, 249, 0.86));
}

.empty-state p {
  margin: 0;
}

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

.form-grid.one {
  grid-template-columns: minmax(0, 1fr);
}

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

.field {
  min-width: 0;
}

.form-panel form {
  display: grid;
  gap: 1rem;
}

.form-panel form > .button-row {
  margin-top: 0.05rem;
}

.field.span-2 {
  grid-column: span 2;
}

.field.span-3 {
  grid-column: span 3;
}

.field label,
.field legend {
  display: block;
  margin: 0 0 0.38rem;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: 0.005em;
}

.field-hint {
  display: block;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
textarea,
select {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-raised);
  box-shadow: inset 0 1px 2px rgba(45, 37, 30, 0.04);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="search"]:hover,
textarea:hover,
select:hover {
  border-color: #91867b;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  border-color: var(--focus);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(15, 111, 154, 0.14),
    inset 0 1px 2px rgba(45, 37, 30, 0.03);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

select[multiple] {
  min-height: 7.25rem;
}

input::placeholder,
textarea::placeholder {
  color: #7f8c91;
  opacity: 1;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.choice input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--evergreen);
}

.details-panel {
  border: 1px solid var(--line);
  border-radius: var(--small-radius);
  background: linear-gradient(145deg, var(--surface-tint), var(--surface));
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.details-panel[open] {
  border-color: #b8ccc6;
  box-shadow: var(--shadow-sm);
}

.details-panel summary {
  min-height: 2.8rem;
  padding: 0.85rem 1rem;
  color: var(--evergreen-dark);
  cursor: pointer;
  font-weight: 700;
}

.details-panel > div {
  padding: 0 0.9rem 0.9rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.comparison-column {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--small-radius);
  background: linear-gradient(145deg, var(--surface-tint), var(--surface));
}

.comparison-column h3 {
  margin: 0 0 0.7rem;
}

.comparison-field + .comparison-field {
  margin-top: 0.85rem;
}

.comparison-field h4 {
  margin: 0;
  font-size: 0.85rem;
}

.comparison-field p {
  margin: 0.22rem 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.comparison-field.changed h4 {
  color: var(--accent-dark);
}

.timeline {
  position: relative;
  display: grid;
  gap: 0.75rem;
  padding-left: 1rem;
}

.timeline::before {
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0.2rem;
  width: 2px;
  background: linear-gradient(var(--accent), var(--evergreen));
  content: "";
}

.timeline-item {
  position: relative;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--small-radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.timeline-item::before {
  position: absolute;
  top: 1.25rem;
  left: -1.08rem;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid var(--evergreen);
  border-radius: 50%;
  background: var(--canvas);
  content: "";
}

.timeline-item h3 {
  margin: 0;
  font-size: 1rem;
}

.timeline-item p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.divider {
  height: 1px;
  margin: 1.15rem 0;
  background: linear-gradient(90deg, var(--line), transparent);
}

.app-footer {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 0 clamp(1.3rem, 4vw, 3rem) 2rem;
  color: var(--faint);
  font-size: 0.8rem;
}

.app-footer p {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  overflow-y: auto;
  place-items: center;
  padding: 1rem;
  background: rgba(33, 31, 28, 0.62);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(100%, 820px);
  max-height: min(92vh, 900px);
  overflow: auto;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(33, 31, 28, 0.38);
}

.modal.wide {
  width: min(100%, 1040px);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  letter-spacing: -0.025em;
}

.modal-heading p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.preview-stat {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--small-radius);
  background: linear-gradient(145deg, var(--surface-tint), var(--surface));
}

.preview-stat strong,
.preview-stat span {
  display: block;
}

.preview-stat strong {
  color: var(--evergreen-dark);
  font-size: 1.3rem;
}

.preview-stat span {
  color: var(--muted);
  font-size: 0.8rem;
}

.conflict-card {
  margin-top: 0.75rem;
  padding: 0.9rem;
  border: 1px solid #e5ca9f;
  border-radius: var(--small-radius);
  background: linear-gradient(145deg, #fff7e9, var(--surface));
}

.conflict-card h3 {
  margin: 0;
  font-size: 1rem;
}

.conflict-card > p {
  margin: 0.3rem 0 0.7rem;
  color: var(--muted);
}

.record-diff {
  max-height: 14rem;
  overflow: auto;
  margin: 0.45rem 0 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f0eb;
  color: #34444a;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.74rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.session-mode {
  width: min(100%, 1100px);
  max-height: 96vh;
  font-size: 1.12rem;
}

.session-mode .modal-heading h2 {
  font-size: clamp(1.5rem, 4vw, 2.3rem);
}

.session-agenda {
  padding-left: 1.3rem;
}

.session-agenda li + li {
  margin-top: 0.5rem;
}

.session-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.search-results {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.search-result {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--small-radius);
  background: var(--surface-raised);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.search-result:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.search-result h3 {
  margin: 0;
  font-size: 0.95rem;
}

.search-result p {
  margin: 0.18rem 0 0;
  color: var(--muted);
}

.small {
  color: var(--muted);
  font-size: 0.82rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .workspace-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    padding: 0.85rem 1rem;
    border-right: 0;
    border-bottom: 0;
  }

  .sidebar .brand-lockup {
    padding: 0 0 0.7rem;
  }

  .sidebar nav {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.15rem 0 0.3rem;
    scrollbar-width: thin;
  }

  .nav-group {
    display: contents;
  }

  .nav-group + .nav-group {
    margin: 0;
  }

  .nav-group-label {
    display: none;
  }

  .nav-link {
    width: auto;
    flex: 0 0 auto;
    min-height: 2.45rem;
    padding: 0.52rem 0.72rem;
    white-space: nowrap;
  }

  .sidebar-bottom {
    display: none;
  }

  .page-heading-illustration {
    width: 11rem;
  }

  .overview-card.wide,
  .overview-card.medium {
    grid-column: span 6;
  }

  .overview-card.third {
    grid-column: span 6;
  }
}

@media (max-width: 620px) {
  .login-shell {
    align-items: start;
    padding: 0.75rem;
  }

  .login-card {
    margin-top: 0.5rem;
    padding: 1.5rem;
    border-radius: 21px;
  }

  .sidebar {
    padding: 0.75rem;
  }

  .sidebar .brand-subtitle {
    display: none;
  }

  .sidebar nav {
    margin-inline: -0.2rem;
  }

  .topbar {
    position: relative;
    padding: 0.75rem 1rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .page {
    padding: 1.25rem 1rem 2rem;
  }

  .page-heading {
    gap: 0.8rem;
    margin-bottom: 1.2rem;
  }

  .page-heading-illustration {
    display: none;
  }

  .page-heading h1 {
    font-size: clamp(1.85rem, 10vw, 2.55rem);
  }

  .panel,
  .form-panel {
    padding: 1rem;
  }

  .form-grid,
  .form-grid.three,
  .comparison-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field.span-2,
  .field.span-3 {
    grid-column: auto;
  }

  .overview-card.wide,
  .overview-card.medium,
  .overview-card.third {
    grid-column: span 12;
  }

  .preview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-row > * {
    flex: 1 1 auto;
  }

  .record-footer .button-quiet {
    flex: 0 0 auto;
  }

  .storage-badge span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
