:root {
  --bg: #090909;
  --bg-soft: #101010;
  --surface: rgba(20, 20, 20, 0.68);
  --surface-2: rgba(28, 28, 28, 0.74);
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #f5f5f6;
  --muted: #a8a8a8;
  --accent: #eef2f6;
  --accent-2: #cfd6df;
  --danger: #f35f4e;
  --weekend-fill: rgba(255, 255, 255, 0.05);
  --label-w: 250px;
  --day-w: 36px;
  --row-h: 58px;
  --radius-m: 14px;
  --radius-l: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Instrument Sans', sans-serif;
  color: var(--text);
  overflow: hidden;
  background: var(--bg);
}

.app-root.is-auth-locked {
  display: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.08), transparent 38%),
    radial-gradient(circle at 88% 86%, rgba(255, 255, 255, 0.05), transparent 42%),
    linear-gradient(180deg, #111111 0%, #070707 100%);
}

.auth-screen.is-hidden {
  display: none;
}

.auth-card {
  width: min(94vw, 380px);
  display: grid;
  gap: 11px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(31, 31, 31, 0.7), rgba(11, 11, 11, 0.88));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
}

.auth-logo {
  width: clamp(190px, 48vw, 240px);
  max-width: 100%;
  height: auto;
  margin: 0 auto 4px;
  display: block;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}

.auth-card label {
  display: grid;
  gap: 5px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #c9c9c9;
}

.auth-card input {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f3f3f3;
  padding: 9px 11px;
  font-size: 0.83rem;
}

.auth-card input::placeholder {
  color: #8f9398;
}

.auth-card input:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.44);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.auth-card button[type='submit'] {
  margin-top: 2px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(180deg, rgba(245, 247, 249, 0.16), rgba(229, 233, 238, 0.08));
  color: #f6f7f8;
  font-weight: 600;
}

.auth-card button[type='submit']:hover {
  border-color: rgba(255, 255, 255, 0.56);
  filter: brightness(1.03);
}

.auth-import-btn {
  min-height: 34px;
  margin-top: 2px;
  font-size: 0.76rem;
}

.auth-import-help {
  display: block;
  margin-top: -4px;
  text-align: center;
  color: #a7adb6;
  font-size: 0.68rem;
}

.auth-card p {
  margin: 0;
  color: #b3b3b3;
  font-size: 0.77rem;
}

.auth-error {
  min-height: 19px;
  color: #ff9191;
  font-size: 0.73rem;
  font-weight: 500;
}

.legal-mention {
  margin: 0;
  font-size: 0.56rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-align: center;
  color: rgba(231, 235, 241, 0.66);
  width: 100%;
}

.auth-legal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.app-root {
  height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.app-legal {
  width: 100%;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: rgba(9, 9, 9, 0.58);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(9, 9, 9, 0.74);
  border-bottom: 1px solid var(--line-soft);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.logo {
  height: clamp(64px, 8.6vh, 88px);
  width: clamp(170px, 20vw, 300px);
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.ghost-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

#sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-size: 14px;
}

.mobile-menu,
.mobile-menu-backdrop,
.mobile-side-head {
  display: none;
}

.header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  padding-bottom: 0;
  position: relative;
}

.header-right > * {
  flex: 0 0 auto;
}

.header-menu-toggle {
  display: none;
  width: auto;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.theme-icon-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  line-height: 1;
}

.header-menu-panel {
  display: flex;
  position: static;
  width: auto;
  max-height: none;
  overflow: visible;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

body.header-folded .header-menu-toggle {
  display: inline-flex;
}

body.header-folded .header-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 95;
  width: min(520px, calc(100vw - 40px));
  max-height: min(74dvh, 560px);
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(13, 17, 23, 0.68);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
}

body.header-folded .header-menu-panel.is-open {
  display: flex;
}

.layout {
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  min-width: 0;
}

.sidebar {
  width: min(328px, 32vw);
  padding: 12px;
  overflow: auto;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.5), rgba(9, 9, 9, 0.68));
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  transition: width 140ms cubic-bezier(0.2, 0, 0, 1), padding 140ms cubic-bezier(0.2, 0, 0, 1);
  contain: layout paint;
  will-change: width, padding;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.sidebar-manage-nav {
  width: 100%;
  margin-bottom: 10px;
  justify-content: flex-start;
}

.sidebar:not(.is-open) {
  width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
}

body.sidebar-animating .sidebar,
body.sidebar-animating .sidebar .card,
body.sidebar-animating .sidebar .check-list,
body.sidebar-animating .sidebar .list-item,
body.sidebar-animating .sidebar .segmented {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.sidebar-animating .sidebar * {
  transition: none !important;
}

.main {
  min-width: 0;
  min-height: 0;
  padding: 12px;
}

.planner-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: var(--radius-l);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.52), rgba(8, 8, 8, 0.7));
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.planner-toolbar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 10, 10, 0.72);
}

.planner-toolbar .segmented {
  background: rgba(12, 12, 12, 0.62);
}

.planner-toolbar .period-label {
  width: auto;
  min-width: 210px;
  margin-left: auto;
}

.legend-dropdown {
  position: static;
  flex: 0 0 auto;
}

.legend-toggle {
  width: auto;
  min-width: 122px;
}

.legend-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 10px;
  right: 10px;
  z-index: 35;
  max-height: min(54dvh, 360px);
  overflow: auto;
  padding: 11px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.11), transparent 48%),
    linear-gradient(180deg, rgba(28, 31, 37, 0.58), rgba(12, 14, 18, 0.72));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.legend-panel[hidden] {
  display: none;
}

.legend-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 0 0 9px;
}

.legend-panel-head h3 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e3e4e6;
}

.legend-panel-head small {
  font-size: 0.71rem;
  color: #b8c0ca;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}

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

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  max-width: 100%;
  width: auto;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.82);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-item.is-active {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.legend-item.is-muted {
  opacity: 0.42;
}

.legend-item:focus-visible {
  outline: 2px solid rgba(236, 242, 250, 0.85);
  outline-offset: 1px;
}

.legend-dot,
.tag {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.card {
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  padding: 10px;
  margin-bottom: 10px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 0.74rem;
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 500;
  color: #eef0f2;
}

.manage-card > input[type='search'] {
  margin: 0 0 10px;
}

.stack-form {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.check-list {
  max-height: 118px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 6px;
  background: rgba(16, 16, 16, 0.94);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 0.74rem;
  color: var(--muted);
}

.check-item input[type='checkbox'] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #e8edf4;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 12, 14, 0.95);
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 7px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

body[data-theme='dark'] .sidebar,
body[data-theme='dark'] .sidebar .card,
body[data-theme='dark'] .sidebar .check-list,
body[data-theme='dark'] .sidebar .list-item,
body[data-theme='dark'] .sidebar .segmented {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body[data-theme='dark'] .sidebar {
  background: linear-gradient(180deg, rgba(16, 16, 16, 0.62), rgba(7, 7, 7, 0.8)) !important;
}

body[data-theme='dark'] .sidebar .card,
body[data-theme='dark'] .sidebar .check-list,
body[data-theme='dark'] .sidebar .list-item {
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.52), rgba(10, 10, 10, 0.64)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -1px 0 rgba(0, 0, 0, 0.36);
}

body[data-theme='dark'] .sidebar .segmented {
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.44), rgba(11, 11, 11, 0.58)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -1px 0 rgba(0, 0, 0, 0.32);
}

body[data-theme='dark'] .app-header {
  background: linear-gradient(180deg, rgba(16, 16, 16, 0.86), rgba(8, 8, 8, 0.82)) !important;
  border-bottom-color: rgba(255, 255, 255, 0.07) !important;
}

body[data-theme='dark'] .planner-shell {
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.5), rgba(7, 7, 7, 0.78)) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -1px 0 rgba(0, 0, 0, 0.46);
}

body[data-theme='dark'] .planner-toolbar,
body[data-theme='dark'] .gantt-nav {
  background: rgba(10, 10, 10, 0.7) !important;
}

body[data-theme='dark'] .legend-toggle {
  background: rgba(18, 18, 18, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

body[data-theme='dark'] .legend-panel {
  border-color: rgba(255, 255, 255, 0.22) !important;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.11), transparent 50%),
    linear-gradient(180deg, rgba(26, 30, 37, 0.62), rgba(11, 13, 17, 0.78)) !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body[data-theme='dark'] .pdf-controls {
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.56), rgba(10, 10, 10, 0.62)) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

body[data-theme='dark'] .pdf-controls select,
body[data-theme='dark'] .pdf-controls button,
body[data-theme='dark'] #export-btn,
body[data-theme='dark'] #import-btn,
body[data-theme='dark'] #reset-btn,
body[data-theme='dark'] #export-pdf-btn {
  background: rgba(18, 18, 18, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

body[data-theme='dark'] .timeline-month,
body[data-theme='dark'] .day-label,
body[data-theme='dark'] .row-label,
body[data-theme='dark'] .head-cell {
  background: rgba(10, 10, 10, 0.92) !important;
}

body[data-theme='dark'] .timeline-week-strip,
body[data-theme='dark'] .timeline-month-strip {
  background:
    var(--weekend-overlay, none),
    linear-gradient(180deg, rgba(10, 10, 10, 0.92), rgba(10, 10, 10, 0.92)) !important;
}

body[data-theme='dark'] .day-label.is-weekend {
  background: rgba(13, 13, 13, 0.96) !important;
  color: #ccd3db !important;
}

body[data-theme='dark'] .day-label.month-marker {
  background: rgba(16, 16, 16, 0.96) !important;
}

.project-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.project-color-indicator {
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  max-width: 8px;
  max-height: 8px;
  border-radius: 50%;
  padding: 0 !important;
  margin: 0;
  border: none;
  background: #7f8b99;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  flex: 0 0 8px;
  line-height: 0;
  font-size: 0;
  vertical-align: middle;
}

.project-color-indicator:hover,
.project-color-indicator:active {
  filter: none;
  transform: none;
}

body[data-theme='light'] .project-color-indicator,
body[data-theme='dark'] .project-color-indicator {
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  min-height: 8px !important;
  max-width: 8px !important;
  max-height: 8px !important;
  border: none !important;
  border-radius: 50% !important;
  padding: 0 !important;
  line-height: 0 !important;
  box-shadow: none !important;
}

.project-color-picker {
  position: absolute;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.project-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: #f1f4f7;
  margin-left: 2px;
}

.project-edit-row input[type='color'] {
  width: 24px;
  min-width: 24px;
  flex: 0 0 auto;
  padding: 1px;
  border-radius: 6px;
}

#project-color {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.project-color-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.new-project-color-indicator {
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  min-height: 8px !important;
  max-width: 8px !important;
  max-height: 8px !important;
  border-radius: 50% !important;
  border: none !important;
  padding: 0 !important;
  background: #8ea4bf;
  display: inline-block !important;
  flex: 0 0 8px;
  margin-left: 2px;
  transform: translateY(0.5px);
}

.project-color-inline-label {
  font-size: 0.73rem;
  color: var(--muted);
  user-select: none;
  line-height: 1;
}

.project-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.list-item small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.list-item strong {
  font-size: 0.74rem;
  font-weight: 500;
}

input,
select,
textarea,
button {
  width: 100%;
  font: inherit;
  color: var(--text);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 11px;
  font-weight: 500;
  font-size: 0.78rem;
}

.danger-hover-outline {
  color: #f1f2f3;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.danger-hover-outline:hover {
  color: #ff6f6f;
  border-color: rgba(255, 111, 111, 0.95);
  background: transparent;
  filter: none;
}

textarea {
  resize: vertical;
}

input[type='color'] {
  min-height: 34px;
  padding: 2px;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  color: #f1f2f3;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 120ms ease, transform 120ms ease, filter 120ms ease;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.5);
  filter: brightness(1.03);
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #f4f6f8;
  border: 1px solid rgba(255, 255, 255, 0.34);
}

button.danger {
  background: linear-gradient(180deg, rgba(174, 24, 24, 0.86), rgba(120, 14, 14, 0.96));
  color: #fff;
  border-color: rgba(255, 96, 96, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 132, 132, 0.35), 0 4px 10px rgba(120, 10, 10, 0.22);
}

.view-btn,
.segmented button {
  width: auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  border-color: rgba(255, 255, 255, 0.26);
  color: #f2f4f6;
}

.mini-btn {
  width: auto;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.history-btn:disabled {
  opacity: 0.42;
  cursor: default;
  filter: none;
  pointer-events: none;
}

.history-controls {
  flex: 0 0 auto;
}

.view-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.manage-tab {
  color: #f2f4f6;
}

.manage-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.manage-card.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.list-item button {
  width: auto;
  min-width: 24px;
  padding: 3px 8px;
  font-size: 0.72rem;
}

.icon-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
}

.project-actions .icon-btn {
  width: auto;
  min-width: 0;
  height: auto;
  border: none;
  border-radius: 0;
  padding: 1px 3px;
  background: transparent;
  box-shadow: none;
  font-size: 0.86rem;
}

.neutral-btn {
  color: #ffffff;
  border: none;
  background: transparent;
  box-shadow: none;
}

.outline-danger {
  color: #ff6f6f;
  border: none;
  background: transparent;
  box-shadow: none;
}

.neutral-btn:hover {
  border-color: rgba(255, 255, 255, 0.7);
  filter: none;
}

.outline-danger:hover {
  border-color: rgba(255, 111, 111, 0.95);
  filter: none;
}

.period-label {
  width: clamp(180px, 22vw, 260px);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 7px 9px;
  color: #f1f4f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
}

.pdf-controls label {
  color: #f1f4f7;
  font-size: 0.7rem;
}

.pdf-controls select,
.pdf-controls button {
  width: auto;
}

#pdf-period,
#pdf-scope,
#pdf-project,
#pdf-resource,
#export-btn,
#import-btn,
#reset-btn,
#export-pdf-btn {
  border-radius: 999px;
}

#pdf-period,
#pdf-scope,
#pdf-project,
#pdf-resource {
  min-width: 88px;
}

.assignment-form button,
menu button {
  width: auto;
}

.gantt-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.gantt-wrap {
  overflow: auto;
  height: 100%;
  cursor: grab;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gantt-wrap::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.gantt-wrap.dragging {
  cursor: grabbing;
  user-select: none;
}

.gantt {
  --timeline-w: calc(var(--days-count, 1) * var(--day-w));
  width: max-content;
  min-width: calc(var(--label-w) + var(--timeline-w));
  background: #07090c;
  position: relative;
  --scroll-left: 0px;
}

.gantt-nav {
  border-top: 1px solid var(--line-soft);
  padding: 6px 10px 8px;
  background: rgba(12, 14, 17, 0.92);
}

#gantt-scroll-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0;
  cursor: pointer;
}

#gantt-scroll-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

#gantt-scroll-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.gantt-head,
.gantt-row {
  display: grid;
  grid-template-columns: var(--label-w) var(--timeline-w);
}

.gantt-head {
  position: sticky;
  top: 0;
  z-index: 6;
}

.head-cell {
  min-height: 34px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 10, 13, 0.9);
  color: #e3e5e8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gantt-head .head-cell:nth-child(1) {
  position: relative;
  left: 0;
  transform: translateX(var(--scroll-left));
  will-change: transform;
  z-index: 9;
  box-shadow: 1px 0 0 var(--line-soft);
}

.timeline-month {
  justify-content: flex-start;
  padding-left: 9px;
  position: relative;
  left: 0;
  top: 0;
  transform: translateX(var(--scroll-left));
  will-change: transform;
  z-index: 10;
  background: rgba(8, 10, 13, 0.9);
  box-shadow: 0 1px 0 var(--line-soft), 0 -1px 0 var(--line-soft);
  white-space: nowrap;
  min-width: max-content;
}

.timeline-days {
  display: grid;
  grid-template-columns: repeat(var(--days-count), var(--day-w));
  width: var(--timeline-w);
  min-width: var(--timeline-w);
}

.timeline-stack {
  width: var(--timeline-w);
  min-width: var(--timeline-w);
  border-bottom: 1px solid var(--line-soft);
}

.timeline-month-strip {
  display: grid;
  grid-template-columns: repeat(var(--days-count), var(--day-w));
  width: var(--timeline-w);
  min-width: var(--timeline-w);
  border-bottom: 1px solid var(--line-soft);
  background:
    var(--weekend-overlay, none),
    linear-gradient(180deg, rgba(8, 10, 13, 0.92), rgba(8, 10, 13, 0.92));
}

.timeline-week-strip {
  display: grid;
  grid-template-columns: repeat(var(--days-count), var(--day-w));
  width: var(--timeline-w);
  min-width: var(--timeline-w);
  border-bottom: 1px solid var(--line-soft);
  background:
    var(--weekend-overlay, none),
    linear-gradient(180deg, rgba(8, 10, 13, 0.9), rgba(8, 10, 13, 0.9));
}

.week-segment {
  display: grid;
  place-items: center;
  min-height: 20px;
  padding: 0;
  color: #d2d8e0;
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 6px;
  color: #e8edf3;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-label {
  border-right: 1px solid var(--line-soft);
  background: rgba(8, 10, 13, 0.95);
  color: #a9afb6;
  text-align: center;
  font-size: 0.64rem;
  line-height: 1.2;
  padding: 5px 0;
  position: relative;
}

.day-label.month-marker {
  color: #f4f7fa;
  font-weight: 700;
  background: rgba(14, 17, 21, 0.98);
}

.day-label.is-weekend {
  background: rgba(16, 19, 24, 0.98);
  color: #bcc4ce;
}

.gantt-row {
  min-height: var(--row-local-h, var(--row-h));
}

.row-label {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 6px;
  display: flex;
  align-items: center;
}

.row-label {
  background: rgba(8, 10, 13, 0.9);
  position: relative;
  left: 0;
  transform: translateX(var(--scroll-left));
  will-change: transform;
  z-index: 5;
  box-shadow: 1px 0 0 var(--line-soft);
}

.row-label.team {
  background: rgba(12, 14, 18, 0.9);
}

.row-label small {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}

.row-label strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.row-track {
  position: relative;
  width: var(--timeline-w);
  min-width: var(--timeline-w);
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.day-hitbox {
  min-height: var(--row-local-h, var(--row-h));
  display: grid;
  grid-template-columns: repeat(var(--days-count), var(--day-w));
  background:
    var(--weekend-overlay, none),
    repeating-linear-gradient(
      90deg,
      rgba(8, 10, 13, 1),
      rgba(8, 10, 13, 1) calc(var(--day-w) - 1px),
      rgba(255, 255, 255, 0.08) calc(var(--day-w) - 1px),
      rgba(255, 255, 255, 0.08) var(--day-w)
    );
}

.gantt-range-select-preview {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border: 1px dashed rgba(191, 214, 255, 0.9);
  background: rgba(145, 178, 230, 0.2);
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
}

.day-hit {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.day-hit:hover {
  background: rgba(255, 255, 255, 0.08);
}

.bar-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 2;
}

.gantt-bar {
  position: absolute;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.6rem;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
}

.gantt-bar.is-dragging {
  cursor: grabbing;
  z-index: 30;
  filter: brightness(1.08);
}

.gantt-bar::after {
  content: none;
}

.gantt-bar.parent {
  top: 6px;
  height: 16px;
  font-size: 0.62rem;
}

.gantt-bar.phase {
  height: 13px;
  font-size: 0.54rem;
  opacity: 0.72;
}

.phase-link {
  position: absolute;
  top: 25px;
  width: 1px;
  height: 7px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.bar-note {
  font-size: 0.56rem;
  border-radius: 999px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.22);
}

.bar-hours {
  margin-left: auto;
  font-size: 0.58rem;
}

dialog {
  width: min(94vw, 560px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(10, 13, 18, 0.84);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.assignment-form {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.dialog-head {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.dialog-head h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.assignment-form p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.dialog-section {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  display: grid;
  gap: 8px;
  overflow: visible;
}

.dialog-section h4 {
  margin: 0;
  font-size: 0.68rem;
  color: #d6dce4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-maintenance-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.phase-editor-head,
.phase-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr) minmax(0, 0.85fr) minmax(138px, 0.7fr);
  gap: 6px;
  align-items: center;
}

.phase-editor-head {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #c4c9cf;
}

.phase-editor-list {
  max-height: 188px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.phase-editor-row > * {
  min-width: 0;
}

.phase-editor-row input {
  border-radius: 11px;
  min-height: 34px;
  width: 100%;
}

.phase-editor-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.phase-editor-actions .mini-btn {
  width: auto;
  min-width: 36px;
}

.phase-editor-row button[data-action='remove'] {
  width: auto;
  min-width: 64px;
}

.field-grid {
  display: grid;
  gap: 8px;
}

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

.date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.assignment-form label {
  display: grid;
  gap: 5px;
  font-size: 0.68rem;
  color: #cfd3d8;
}

.assignment-form input,
.assignment-form select,
.assignment-form textarea {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 9, 13, 0.6);
  color: #eef0f2;
  padding: 8px 10px;
}

.apply-hours-wrap {
  align-content: end;
}

.day-hours-panel {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(11, 13, 16, 0.82);
  padding: 8px;
}

.day-hours-panel h4 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-hours-editor {
  max-height: 160px;
  overflow: auto;
  display: grid;
  gap: 5px;
}

.day-hours-row {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 6px;
  align-items: center;
  font-size: 0.74rem;
}

.day-hours-row input {
  padding: 6px;
}

menu {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.dialog-actions {
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

#account-current-user {
  color: var(--muted);
}

.assignment-form[data-mode='phase'] .main-range-group {
  display: none;
}

body[data-theme='light'] {
  color: #1a1f26;
  background: #e9eef4;
  --weekend-fill: rgba(0, 0, 0, 0.06);
}

body[data-theme='light'] .auth-screen {
  background:
    radial-gradient(circle at 15% 22%, rgba(131, 146, 166, 0.2), transparent 40%),
    radial-gradient(circle at 88% 84%, rgba(112, 128, 148, 0.12), transparent 44%),
    linear-gradient(180deg, #eff3f8 0%, #e1e7ef 100%);
}

body[data-theme='light'] .auth-card {
  border-color: rgba(41, 52, 66, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 248, 252, 0.86));
  box-shadow: 0 12px 30px rgba(36, 48, 64, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body[data-theme='light'] .auth-card h1 {
  color: #1f2a37;
}

body[data-theme='light'] .auth-card p,
body[data-theme='light'] .auth-card label {
  color: #516072;
}

body[data-theme='light'] .auth-card input {
  background: rgba(255, 255, 255, 0.78);
  color: #1f2a37;
  border-color: rgba(62, 78, 98, 0.24);
}

body[data-theme='light'] .auth-card input::placeholder {
  color: #7e8da2;
}

body[data-theme='light'] .auth-card input:focus-visible {
  border-color: rgba(62, 78, 98, 0.5);
  box-shadow: 0 0 0 3px rgba(97, 115, 136, 0.16);
}

body[data-theme='light'] .auth-card button[type='submit'] {
  color: #1f2a37;
  border-color: rgba(62, 78, 98, 0.32);
  background: linear-gradient(180deg, rgba(243, 247, 252, 0.88), rgba(229, 237, 246, 0.84));
}

body[data-theme='light'] .auth-error {
  color: #cf3947;
}

body[data-theme='light'] .legal-mention {
  color: rgba(41, 53, 67, 0.66);
}

body[data-theme='light'] .app-legal {
  border-top-color: rgba(22, 33, 46, 0.16);
  background: rgba(244, 248, 252, 0.9);
}

body[data-theme='light'] .app-header,
body[data-theme='light'] .sidebar,
body[data-theme='light'] .planner-shell,
body[data-theme='light'] .card,
body[data-theme='light'] .list-item,
body[data-theme='light'] .segmented,
body[data-theme='light'] .header-menu-panel,
body[data-theme='light'] .legend-item,
body[data-theme='light'] .period-label,
body[data-theme='light'] .gantt,
body[data-theme='light'] .row-label,
body[data-theme='light'] .head-cell,
body[data-theme='light'] .timeline-month,
body[data-theme='light'] .day-label,
body[data-theme='light'] .pdf-controls,
body[data-theme='light'] dialog,
body[data-theme='light'] .dialog-section {
  background: rgba(255, 255, 255, 0.74) !important;
  color: #1a1f26 !important;
  border-color: rgba(22, 33, 46, 0.18) !important;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

body[data-theme='light'] .timeline-week-strip,
body[data-theme='light'] .timeline-month-strip {
  background:
    var(--weekend-overlay, none),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.74)) !important;
}

body[data-theme='light'] .planner-toolbar,
body[data-theme='light'] .gantt-nav {
  background: rgba(241, 245, 250, 0.88) !important;
  border-color: rgba(22, 33, 46, 0.18) !important;
}

body[data-theme='light'] .legend-toggle {
  background: rgba(248, 251, 255, 0.9) !important;
  border-color: rgba(35, 50, 66, 0.28) !important;
}

body[data-theme='light'] .legend-panel {
  border-color: rgba(35, 50, 66, 0.24) !important;
  background:
    radial-gradient(circle at 14% 18%, rgba(101, 122, 148, 0.2), transparent 50%),
    linear-gradient(180deg, rgba(250, 253, 255, 0.86), rgba(235, 242, 250, 0.84)) !important;
  box-shadow: 0 18px 38px rgba(32, 49, 69, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body[data-theme='light'] .day-hours-panel,
body[data-theme='light'] .dialog-head,
body[data-theme='light'] .phase-editor-list,
body[data-theme='light'] .check-list {
  background: rgba(248, 250, 253, 0.95) !important;
  border-color: rgba(22, 33, 46, 0.18) !important;
}

body[data-theme='light'] .check-item {
  color: #2e3a49 !important;
}

body[data-theme='light'] .check-item input[type='checkbox'] {
  background: #ffffff !important;
  border-color: rgba(22, 33, 46, 0.3) !important;
}

body[data-theme='light'] .day-hitbox {
  background:
    var(--weekend-overlay, none),
    repeating-linear-gradient(
      90deg,
      #f6f8fb,
      #f6f8fb calc(var(--day-w) - 1px),
      rgba(22, 33, 46, 0.09) calc(var(--day-w) - 1px),
      rgba(22, 33, 46, 0.09) var(--day-w)
    ) !important;
}

body[data-theme='light'] .gantt-range-select-preview {
  border-color: rgba(49, 76, 112, 0.5);
  background: rgba(108, 142, 189, 0.2);
}

body[data-theme='light'] input,
body[data-theme='light'] select,
body[data-theme='light'] textarea,
body[data-theme='light'] button {
  color: #1a1f26;
  border-color: rgba(22, 33, 46, 0.24);
  background: rgba(255, 255, 255, 0.82);
}

body[data-theme='light'] .view-btn,
body[data-theme='light'] .segmented button,
body[data-theme='light'] .manage-tab {
  color: #25303d;
}

body[data-theme='light'] .view-btn.active,
body[data-theme='light'] .manage-tab.active {
  color: #1f2a37;
  background: rgba(226, 233, 242, 0.58);
  border-color: rgba(98, 110, 127, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), inset 0 -1px 0 rgba(138, 149, 165, 0.22);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

body[data-theme='light']:not(.header-folded) .header-menu-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-theme='light'] .project-name,
body[data-theme='light'] .pdf-controls label,
body[data-theme='light'] .week-segment,
body[data-theme='light'] .month-segment,
body[data-theme='light'] .row-label small,
body[data-theme='light'] .list-item small,
body[data-theme='light'] .legend-panel-head h3,
body[data-theme='light'] .legend-panel-head small {
  color: #2f3b4c !important;
}

body[data-theme='light'] .legend-item.is-active {
  border-color: rgba(33, 47, 64, 0.42);
  box-shadow: inset 0 0 0 1px rgba(33, 47, 64, 0.14);
}

body[data-theme='light'] .day-label {
  color: #3d4a5c !important;
}

body[data-theme='light'] .day-label.month-marker,
body[data-theme='light'] .period-label {
  color: #1f2a37 !important;
}

body[data-theme='light'] .day-label.is-weekend {
  background: rgba(240, 244, 249, 0.9) !important;
  color: #2f3d4f !important;
}

body[data-theme='light'] .day-label.month-marker.is-weekend {
  background: rgba(235, 240, 246, 0.92) !important;
}

body[data-theme='light'] .gantt-bar {
  color: #18202b !important;
  text-shadow: none;
  border-color: rgba(30, 42, 56, 0.4);
  box-shadow: none;
}

body[data-theme='light'] .phase-link {
  background: rgba(46, 58, 74, 0.44);
  box-shadow: none;
}

body[data-theme='light'] .gantt-bar::after {
  content: none;
}

body[data-theme='light'] .dialog-section h4 {
  color: #405066 !important;
}

body.adaptive-mobile .app-root {
  grid-template-rows: auto 1fr auto;
}

body.adaptive-mobile .app-header {
  padding: 7px 8px;
  gap: 6px;
}

body.adaptive-mobile .header-left {
  gap: 7px;
}

body.adaptive-mobile .ghost-btn {
  width: 28px;
  height: 28px;
}

body.adaptive-mobile .logo {
  height: 58px;
  max-width: calc(100vw - 56px);
}

body.adaptive-mobile .header-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

body.adaptive-mobile .header-right > * {
  flex: 0 0 auto;
}

body.adaptive-mobile .header-menu-panel .manage-nav,
body.adaptive-mobile .pdf-controls,
body.adaptive-mobile #export-btn,
body.adaptive-mobile #import-btn,
body.adaptive-mobile #reset-btn {
  display: none;
}

body.adaptive-mobile .mobile-menu-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  z-index: 70;
}

body.adaptive-mobile .mobile-menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.adaptive-mobile .mobile-menu {
  display: grid;
  gap: 8px;
  position: fixed;
  top: 56px;
  left: 8px;
  right: auto;
  width: min(78vw, 280px);
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(10, 12, 15, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(calc(-100% - 18px));
  opacity: 0;
  pointer-events: none;
  transition: transform 160ms ease, opacity 160ms ease;
  z-index: 80;
}

body.adaptive-mobile .mobile-menu.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

body.adaptive-mobile .mobile-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(12, 14, 17, 0.96);
}

body.adaptive-mobile .sidebar {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  max-height: none;
  border: none;
  padding: 10px;
  z-index: 85;
  background: rgba(12, 14, 17, 0.99);
  overflow: auto;
}

body.adaptive-mobile .sidebar.mobile-open {
  display: block;
}

@media (max-width: 1160px) {
  :root {
    --label-w: 210px;
    --day-w: 28px;
  }

  .header-right {
    justify-content: flex-start;
  }

  .logo {
    height: 78px;
    max-width: min(64vw, 900px);
  }

  .header-right {
    gap: 4px;
  }
}

@media (max-width: 920px) {
  .app-header {
    align-items: stretch;
    gap: 8px;
  }

  .header-left,
  .header-right {
    width: 100%;
  }

  .header-right {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .header-right > * {
    flex: 0 0 auto;
  }

  .segmented {
    flex-wrap: nowrap;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: relative;
    width: 100%;
    max-height: 38dvh;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    z-index: 1;
    box-shadow: none;
  }

  .sidebar:not(.is-open) {
    width: 100%;
    max-height: 0;
    padding: 0;
    border-bottom: none;
  }

  .logo {
    height: 64px;
    max-width: min(90vw, 680px);
  }

  .main {
    min-height: 0;
    padding: 8px;
  }

  .planner-shell {
    border-radius: 10px;
    min-height: 0;
  }

  .planner-toolbar {
    padding: 7px 8px;
  }

  .legend-toggle {
    min-width: 108px;
  }

  .legend-panel {
    left: 8px;
    right: 8px;
    max-height: min(50dvh, 320px);
  }

  .planner-toolbar .period-label {
    margin-left: 0;
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .period-label {
    width: 100%;
    text-align: left;
  }

  .segmented,
  .pdf-controls,
  .period-label,
  #export-btn,
  #import-btn,
  #reset-btn {
    flex: 0 0 auto;
  }

  .pdf-controls {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .pdf-controls label {
    width: 100%;
  }

  #pdf-period,
  #pdf-scope,
  #pdf-project,
  #pdf-resource,
  #export-pdf-btn {
    width: auto;
  }

  #export-btn,
  #import-btn,
  #reset-btn {
    width: 100%;
  }

  .gantt-wrap {
    min-height: 0;
  }

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

  .field-grid.two,
  .date-range {
    grid-template-columns: 1fr;
  }

  .phase-editor-head {
    display: none;
  }

  .phase-editor-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-root {
    grid-template-rows: auto 1fr auto;
  }

  .app-header {
    padding: 7px 8px;
    gap: 6px;
  }

  .header-left {
    gap: 7px;
  }

  .ghost-btn {
    width: 28px;
    height: 28px;
  }

  .logo {
    height: 58px;
    max-width: calc(100vw - 56px);
  }

  .header-right {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .header-right > * {
    flex: 0 0 auto;
  }

  .legend-panel {
    left: 6px;
    right: 6px;
    max-height: min(56dvh, 300px);
    padding: 10px;
  }

  .legend-item {
    font-size: 0.7rem;
  }

  .header-menu-panel .manage-nav,
  .pdf-controls,
  #export-btn,
  #import-btn,
  #reset-btn {
    display: none;
  }

  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
    z-index: 70;
  }

  .mobile-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu {
    display: grid;
    gap: 8px;
    position: fixed;
    top: 56px;
    left: 8px;
    right: auto;
    width: min(78vw, 280px);
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(10, 12, 15, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateX(calc(-100% - 18px));
    opacity: 0;
    pointer-events: none;
    transition: transform 160ms ease, opacity 160ms ease;
    z-index: 80;
  }

  .mobile-menu.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 0 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(12, 14, 17, 0.96);
  }

  .segmented {
    flex-wrap: nowrap;
  }

  .sidebar {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    max-height: none;
    border: none;
    padding: 10px;
    z-index: 85;
    background: rgba(12, 14, 17, 0.99);
    overflow: auto;
  }

  .sidebar.mobile-open {
    display: block;
  }

  .card {
    padding: 8px;
    margin-bottom: 8px;
  }

  .manage-card > input[type='search'] {
    margin: 0 0 8px;
  }

  input,
  select,
  textarea,
  button {
    font-size: 0.74rem;
    padding: 6px 9px;
  }

  .view-btn,
  .segmented button {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .list-item {
    padding: 5px 6px;
  }

  .gantt-head,
  .gantt-row {
    grid-template-columns: var(--label-w) var(--timeline-w);
  }

  dialog {
    width: min(98vw, 560px);
    max-height: 92dvh;
  }

  .assignment-form {
    max-height: 88dvh;
    overflow: auto;
    padding: 10px;
  }
}

/* Harmonisation visuelle portail/rapports + optimisation mobile direction */
:root {
  --brand-ink: #3a3d44;
  --brand-ink-strong: #25272d;
  --brand-accent: #d39b3d;
  --brand-accent-deep: #c9892a;
  --brand-soft: rgba(211, 155, 61, 0.14);
}

body[data-theme='light'] {
  background:
    radial-gradient(circle at 8% -12%, rgba(211, 155, 61, 0.16), transparent 44%),
    radial-gradient(circle at 95% 6%, rgba(58, 61, 68, 0.12), transparent 42%),
    linear-gradient(180deg, #f5f5f6 0%, #eceef2 100%);
}

body[data-theme='dark'] {
  background:
    radial-gradient(circle at 86% 4%, rgba(211, 155, 61, 0.12), transparent 48%),
    linear-gradient(180deg, #17191d 0%, #111316 100%);
}

body[data-theme='dark'] .app-header,
body[data-theme='dark'] .sidebar,
body[data-theme='dark'] .planner-shell,
body[data-theme='dark'] .card,
body[data-theme='dark'] .list-item,
body[data-theme='dark'] .header-menu-panel,
body[data-theme='dark'] .legend-panel,
body[data-theme='dark'] .pdf-controls,
body[data-theme='dark'] .dialog-head,
body[data-theme='dark'] .dialog-section,
body[data-theme='dark'] .day-hours-panel,
body[data-theme='dark'] .phase-editor-list,
body[data-theme='dark'] dialog {
  background: rgba(35, 38, 43, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f1f2f3 !important;
}

body[data-theme='light'] .app-header,
body[data-theme='light'] .sidebar,
body[data-theme='light'] .planner-shell,
body[data-theme='light'] .card,
body[data-theme='light'] .list-item,
body[data-theme='light'] .header-menu-panel,
body[data-theme='light'] .legend-panel,
body[data-theme='light'] .pdf-controls,
body[data-theme='light'] .dialog-head,
body[data-theme='light'] .dialog-section,
body[data-theme='light'] .day-hours-panel,
body[data-theme='light'] .phase-editor-list,
body[data-theme='light'] dialog {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(58, 61, 68, 0.18) !important;
  color: var(--brand-ink-strong) !important;
}

.app-header {
  border-bottom: 1px solid rgba(58, 61, 68, 0.14) !important;
  box-shadow: 0 8px 22px rgba(27, 30, 36, 0.07);
}

.header-menu-panel {
  border-radius: 16px !important;
  box-shadow: 0 18px 36px rgba(28, 33, 42, 0.16);
}

.sidebar,
.planner-shell,
.card,
dialog {
  border-radius: 16px !important;
}

.planner-shell {
  box-shadow: 0 16px 34px rgba(24, 28, 35, 0.1);
}

.planner-toolbar,
.gantt-nav {
  border-radius: 12px;
  border: 1px solid rgba(58, 61, 68, 0.16);
}

.view-btn.active,
.manage-tab.active {
  border-color: color-mix(in srgb, var(--brand-accent) 56%, #7d8692 44%) !important;
  background: linear-gradient(180deg, rgba(211, 155, 61, 0.2), rgba(211, 155, 61, 0.11)) !important;
}

.theme-icon-btn,
#export-btn,
#export-pdf-btn,
#account-btn,
#logout-btn,
.header-menu-toggle {
  border-radius: 12px !important;
}

button,
input,
select,
textarea {
  border-radius: 12px !important;
}

.terrain-access-grid {
  margin-top: 2px;
}

.terrain-access-actions {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.terrain-access-feedback {
  min-height: 18px;
  margin: 0;
  font-size: 0.75rem;
  color: #2f3c4f;
}

.terrain-access-feedback.is-error {
  color: #c9333f;
}

body[data-theme='dark'] .terrain-access-feedback {
  color: #cfd5de;
}

body[data-theme='dark'] .terrain-access-feedback.is-error {
  color: #ff9ea7;
}

@media (max-width: 800px) {
  :root {
    --label-w: 176px;
    --day-w: 24px;
    --row-h: 54px;
  }

  .main {
    padding: 8px;
  }

  .planner-toolbar {
    gap: 8px;
  }

  .planner-toolbar > .segmented {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .planner-toolbar > .segmented > button {
    width: 100%;
    min-height: 40px;
  }

  .planner-toolbar .legend-dropdown,
  .planner-toolbar .period-label {
    width: 100%;
  }

  .period-label {
    text-align: left;
    font-weight: 600;
  }

  .pdf-controls select,
  .pdf-controls button {
    min-height: 40px;
  }
}

@media (max-width: 640px) {
  :root {
    --label-w: 152px;
    --day-w: 22px;
    --row-h: 52px;
  }

  body.adaptive-mobile .app-header {
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  }

  body.adaptive-mobile .logo {
    height: 50px;
    max-width: min(67vw, 260px);
  }

  body.adaptive-mobile .header-right {
    justify-content: flex-end;
    overflow: visible;
  }

  body.adaptive-mobile .header-menu-toggle {
    min-width: 76px;
    min-height: 38px;
  }

  body.adaptive-mobile .main {
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  body.adaptive-mobile .planner-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px;
  }

  body.adaptive-mobile .planner-toolbar > .segmented {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body.adaptive-mobile .planner-toolbar > .segmented button {
    min-height: 40px;
    font-size: 0.78rem;
  }

  body.adaptive-mobile .mobile-menu {
    top: 62px;
    left: 10px;
    right: 10px;
    width: auto;
    border-radius: 14px;
  }

  body.adaptive-mobile .sidebar {
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  }

  body.adaptive-mobile .sidebar .card {
    padding: 10px;
    margin-bottom: 10px;
  }

  body.adaptive-mobile input,
  body.adaptive-mobile select,
  body.adaptive-mobile textarea,
  body.adaptive-mobile button {
    font-size: 16px !important;
    min-height: 42px;
  }

  body.adaptive-mobile .view-btn,
  body.adaptive-mobile .segmented button {
    font-size: 0.8rem !important;
    padding-inline: 8px !important;
  }

  body.adaptive-mobile .list-item {
    padding: 8px 10px;
  }

  body.adaptive-mobile dialog {
    width: min(96vw, 560px);
    margin-inline: auto;
  }

  body.adaptive-mobile .assignment-form {
    max-height: 90dvh;
    padding: 12px;
  }
}

/* Cohérence visuelle direction / portail / rapports */
:root {
  --portal-font: 'SF Pro Display', 'Avenir Next', 'Helvetica Neue', 'Instrument Sans', sans-serif;
  --portal-accent: #d39b3d;
  --portal-accent-deep: #c58726;
  --portal-ink: #2f3136;
  --portal-ink-soft: #6c717c;
}

body {
  font-family: var(--portal-font);
}

body[data-theme='light'] {
  --direction-bg: #f5f5f6;
  --direction-bg-soft: #eceef2;
  --direction-surface: rgba(255, 255, 255, 0.94);
  --direction-surface-strong: #ffffff;
  --direction-line: rgba(47, 49, 54, 0.14);
  --direction-line-strong: rgba(47, 49, 54, 0.24);
  --direction-shadow: 0 18px 42px rgba(25, 30, 36, 0.12);
  --direction-text: var(--portal-ink);
  --direction-muted: var(--portal-ink-soft);
}

body[data-theme='dark'] {
  --direction-bg: #17191d;
  --direction-bg-soft: #121418;
  --direction-surface: rgba(36, 39, 45, 0.9);
  --direction-surface-strong: rgba(46, 50, 58, 0.96);
  --direction-line: rgba(255, 255, 255, 0.14);
  --direction-line-strong: rgba(255, 255, 255, 0.26);
  --direction-shadow: 0 24px 46px rgba(0, 0, 0, 0.35);
  --direction-text: #f1f2f5;
  --direction-muted: #b6bcc6;
}

body[data-theme='light'],
body[data-theme='dark'] {
  color: var(--direction-text);
  background:
    radial-gradient(circle at 10% -12%, rgba(211, 155, 61, 0.16), transparent 42%),
    radial-gradient(circle at 94% 4%, rgba(58, 61, 68, 0.1), transparent 44%),
    linear-gradient(180deg, var(--direction-bg), var(--direction-bg-soft));
}

.auth-screen {
  background:
    radial-gradient(circle at 12% -6%, rgba(211, 155, 61, 0.26), transparent 46%),
    radial-gradient(circle at 88% 104%, rgba(58, 61, 68, 0.2), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--direction-bg) 93%, #ffffff 7%), var(--direction-bg));
}

.auth-card {
  position: relative;
  width: min(90vw, 344px);
  gap: 8px;
  padding: 16px 14px;
  border-radius: 24px;
  border: 1px solid var(--direction-line);
  background: var(--direction-surface);
  color: var(--direction-text);
  box-shadow: var(--direction-shadow);
  backdrop-filter: blur(14px) saturate(112%);
  -webkit-backdrop-filter: blur(14px) saturate(112%);
}

.auth-home-action-link {
  position: absolute;
  top: 10px;
  right: 10px;
}

.auth-logo {
  width: clamp(180px, 48vw, 240px);
  margin-bottom: 1px;
}

.auth-card h1 {
  margin: 0 0 2px;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--direction-text);
}

.auth-card label {
  color: var(--direction-text);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.79rem;
  font-weight: 600;
}

.auth-card input {
  min-height: 44px;
  border-radius: 13px;
  border: 1px solid var(--direction-line);
  background: var(--direction-surface-strong);
  color: var(--direction-text);
  font-size: 0.9rem;
}

.auth-card button[type='submit'] {
  min-height: 44px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--portal-accent) 50%, var(--direction-line) 50%);
  background: linear-gradient(180deg, rgba(211, 155, 61, 0.24), rgba(211, 155, 61, 0.12));
  color: var(--direction-text);
  font-weight: 700;
}

.auth-error {
  min-height: 18px;
  font-size: 0.76rem;
}

.app-header,
.sidebar,
.planner-shell,
.card,
.list-item,
.header-menu-panel,
.legend-panel,
.pdf-controls,
.dialog-head,
.dialog-section,
.day-hours-panel,
.phase-editor-list,
dialog {
  border-color: var(--direction-line) !important;
  background: var(--direction-surface) !important;
  color: var(--direction-text) !important;
  box-shadow: var(--direction-shadow);
}

.app-header {
  margin: 10px 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--direction-line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.layout {
  height: 100%;
  padding: 10px;
  gap: 10px;
  align-items: stretch;
}

.sidebar {
  border: 1px solid var(--direction-line);
  border-radius: 18px;
}

.main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  padding: 0;
}

.planner-shell {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--direction-line);
  border-radius: 18px !important;
}

.planner-toolbar,
.gantt-nav,
.period-label,
.segmented,
.check-list,
.legend-item,
.project-color-indicator {
  border-color: var(--direction-line) !important;
}

.gantt-body {
  min-height: 0;
}

#gantt-scroll-slider {
  height: 2px;
  border: 0;
  background: color-mix(in srgb, var(--direction-line) 86%, transparent 14%);
  opacity: 0.78;
}

#gantt-scroll-slider::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--direction-line-strong) 60%, #ffffff 40%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--direction-surface) 86%, transparent 14%);
  background: color-mix(in srgb, var(--portal-accent) 78%, var(--direction-surface-strong) 22%);
}

#gantt-scroll-slider::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--direction-line-strong) 60%, #ffffff 40%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--direction-surface) 86%, transparent 14%);
  background: color-mix(in srgb, var(--portal-accent) 78%, var(--direction-surface-strong) 22%);
}

button,
input,
select,
textarea,
.secondary,
.mini-btn,
.view-btn,
.manage-tab {
  border-radius: 12px !important;
}

button,
.secondary,
.mini-btn,
.view-btn,
.manage-tab {
  border-color: var(--direction-line) !important;
  background: color-mix(in srgb, var(--direction-surface-strong) 84%, transparent 16%);
  color: var(--direction-text);
}

.view-btn.active,
.manage-tab.active,
.segmented .active {
  border-color: color-mix(in srgb, var(--portal-accent) 56%, var(--direction-line-strong) 44%) !important;
  background: linear-gradient(180deg, rgba(211, 155, 61, 0.24), rgba(211, 155, 61, 0.12)) !important;
}

input,
select,
textarea {
  min-height: 40px;
  background: var(--direction-surface-strong) !important;
  color: var(--direction-text) !important;
  border: 1px solid var(--direction-line) !important;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--direction-muted) 84%, #ffffff 16%);
}

.theme-icon-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 50% !important;
}

.home-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}

.header-home-action-link {
  flex: 0 0 auto;
}

.home-action-icon {
  width: 16px;
  height: 16px;
}

.header-menu-toggle {
  min-height: 36px;
  border-radius: 12px !important;
}

.mobile-menu {
  border-radius: 16px;
  border: 1px solid var(--direction-line);
  background: var(--direction-surface-strong);
  box-shadow: var(--direction-shadow);
}

.mobile-menu-backdrop {
  background: rgba(12, 15, 19, 0.44);
}

.legal-mention {
  color: color-mix(in srgb, var(--direction-muted) 82%, #ffffff 18%);
}

body[data-theme='dark'] .auth-card,
body[data-theme='dark'] .mobile-menu,
body[data-theme='dark'] .header-menu-panel {
  background: var(--direction-surface-strong) !important;
}

@media (max-width: 980px) {
  .app-header {
    margin: 8px 8px 0;
  }

  .layout {
    padding: 8px;
  }
}

@media (max-width: 640px) {
  body.adaptive-mobile .app-header {
    margin: max(6px, env(safe-area-inset-top)) 6px 0;
    padding: 8px 9px;
    border-radius: 16px;
  }

  body.adaptive-mobile .logo {
    height: 46px;
    max-width: min(64vw, 232px);
  }

  body.adaptive-mobile .header-menu-toggle {
    min-width: 66px;
    min-height: 36px;
  }

  body.adaptive-mobile .layout {
    padding: 6px;
    gap: 6px;
    height: 100%;
  }

  body.adaptive-mobile .sidebar {
    inset: 0;
    border-radius: 0;
    border: 0;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    background: var(--direction-bg);
  }

  body.adaptive-mobile .sidebar .card {
    border-radius: 14px !important;
    margin-bottom: 8px;
    padding: 10px;
  }

  body.adaptive-mobile .planner-shell {
    border-radius: 14px !important;
  }

  body.adaptive-mobile .main {
    display: flex;
    min-height: 0;
    height: 100%;
  }

  body.adaptive-mobile .planner-toolbar {
    padding: 10px;
    gap: 8px;
  }

  body.adaptive-mobile .planner-toolbar > .segmented {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  body.adaptive-mobile .planner-toolbar > .segmented button {
    min-height: 40px;
    padding-inline: 6px !important;
    font-size: 0.78rem !important;
  }

  body.adaptive-mobile .mobile-menu {
    left: 8px;
    right: 8px;
    top: 60px;
    padding: 10px;
  }

  body.adaptive-mobile .mobile-menu button {
    min-height: 42px;
    font-size: 0.86rem !important;
  }

  body.adaptive-mobile .mobile-home-action-link {
    align-self: flex-start;
  }

  body.adaptive-mobile input,
  body.adaptive-mobile select,
  body.adaptive-mobile textarea,
  body.adaptive-mobile button {
    font-size: 16px !important;
  }

  .auth-card {
    width: min(90vw, 344px);
    padding: 14px 12px;
    border-radius: 20px;
  }

  .auth-logo {
    width: min(74vw, 210px);
  }
}
