:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f1e8;
  color: #211b16;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(213, 121, 64, 0.2), transparent 32rem),
    linear-gradient(135deg, #f8f0e4 0%, #efe3d3 48%, #f9f5ed 100%);
  line-height: 1.6;
}

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

button {
  cursor: pointer;
}

a {
  color: #8f2f12;
  font-weight: 800;
}

.auth-card,
.dashboard-card {
  width: min(100%, 440px);
  padding: clamp(24px, 6vw, 36px);
  border: 1px solid #ddcfbd;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.9);
  box-shadow: 0 24px 70px rgba(64, 45, 27, 0.14);
}

.dashboard-card {
  width: min(100%, 680px);
  display: grid;
  gap: 24px;
}

.wide-card {
  width: min(100%, 860px);
}

.dashboard-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #9a4a20;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 9vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.muted {
  margin: 0 0 24px;
  color: #716052;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.compact-form {
  max-width: 460px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 1px solid #cdbda9;
  border-radius: 14px;
  padding: 13px 14px;
  background: #fffaf3;
}

input:focus,
select:focus {
  border-color: #b85f2e;
  outline: 3px solid rgba(213, 121, 64, 0.28);
}

button {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: #211b16;
  color: #fffaf3;
  font-weight: 900;
}

button:hover {
  background: #b85f2e;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-button {
  border: 1px solid rgba(132, 104, 75, 0.28);
  background: #fffaf3;
  color: #211b16;
}

.secondary-button:hover {
  background: #fff1eb;
}

.auth-link {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
}

.error {
  margin: 0;
  border: 1px solid #d79a82;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff1eb;
  color: #8f2f12;
  font-weight: 800;
}

.success {
  margin: 0;
  border: 1px solid #a3c985;
  border-radius: 14px;
  padding: 12px 14px;
  background: #f0ffe9;
  color: #2e6d18;
  font-weight: 800;
}

.workspace-panel {
  display: grid;
  gap: 14px;
  border-top: 1px solid rgba(132, 104, 75, 0.22);
  padding-top: 22px;
}

.workspace-index-body {
  display: grid;
  gap: 24px;
  padding: 24px;
}

.workspace-panel h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

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

.workspace-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(132, 104, 75, 0.22);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 250, 243, 0.7);
  color: inherit;
  text-decoration: none;
}

.workspace-list a:hover {
  border-color: rgba(184, 95, 46, 0.46);
  background: #fff1eb;
}

.workspace-list span {
  display: grid;
  gap: 2px;
}

.workspace-list small,
.workspace-list em {
  color: #716052;
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 800;
}

.workspace-list em {
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(46, 109, 24, 0.12);
  color: #2e6d18;
}

.back-link {
  width: max-content;
  color: #9a4a20;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.stats-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(132, 104, 75, 0.22);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 250, 243, 0.7);
}

.stats-grid dt {
  color: #9a4a20;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-grid dd {
  margin: 0;
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.dashboard-body {
  display: block;
  padding: 0;
  background: #f6f1e8;
}

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

.dashboard-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  height: 100vh;
  border-right: 1px solid rgba(132, 104, 75, 0.2);
  padding: 24px;
  background: #241b15;
  color: #fffaf3;
}

.brand {
  display: inline-flex;
  margin-bottom: 28px;
  color: #fffaf3;
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.dashboard-sidebar nav,
.habit-list-table,
.habit-list-section,
.selected-habit-panel,
.selected-habit-details,
.habit-form,
.habit-kind-fieldset {
  display: grid;
}

.dashboard-sidebar nav {
  gap: 8px;
}

.dashboard-sidebar nav a {
  display: grid;
  gap: 2px;
  border-radius: 16px;
  padding: 12px 14px;
  color: rgba(255, 250, 243, 0.78);
  text-decoration: none;
}

.dashboard-sidebar nav a.active,
.dashboard-sidebar nav a:hover {
  background: rgba(255, 250, 243, 0.1);
  color: #fffaf3;
}

.sidebar-user-email {
  color: rgba(255, 250, 243, 0.56);
  font-size: 0.8rem;
  font-weight: 800;
}

.sidebar-user-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 250, 243, 0.08);
  color: #fffaf3;
  text-decoration: none;
}

.sidebar-user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #d57940;
  color: #241b15;
  font-weight: 950;
}

.sidebar-user-copy {
  min-width: 0;
}

.sidebar-user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-form button {
  width: 100%;
  background: rgba(255, 250, 243, 0.12);
}

.dashboard-workspace {
  min-width: 0;
}

.dashboard-main {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px);
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.habit-table-panel,
.selected-habit-panel,
.habit-panel {
  border: 1px solid rgba(132, 104, 75, 0.22);
  border-radius: 28px;
  background: rgba(255, 252, 247, 0.88);
  box-shadow: 0 24px 70px rgba(64, 45, 27, 0.1);
}

.habit-table-panel {
  overflow: hidden;
}

.habit-table-toolbar,
.habit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid rgba(132, 104, 75, 0.16);
}

.habit-table-toolbar h1,
.habit-panel-header h2 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.95;
}

.habit-table-toolbar time {
  color: #716052;
  font-weight: 800;
}

.habit-list-section-header {
  margin: 0;
  padding: 20px 24px 8px;
  color: #716052;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.habit-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px auto;
  gap: 14px;
  align-items: center;
  border-top: 1px solid rgba(132, 104, 75, 0.14);
  padding: 16px 24px;
}

.habit-row:first-child {
  border-top: 0;
}

.habit-row.active,
.habit-row:hover {
  background: #fff7ed;
}

.habit-row.completed {
  color: #716052;
}

.habit-row-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.habit-row-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.habit-row-icon {
  width: 34px;
  height: 34px;
  border: 2px solid #d6c4ad;
  border-radius: 50%;
  background: #fffaf3;
}

.habit-row-icon-overdue {
  border-color: #b3391d;
  background: #fff1eb;
}

.habit-row-icon-done {
  border-color: #2e6d18;
  background: radial-gradient(circle, #2e6d18 38%, #fffaf3 42%);
}

.habit-row-main,
.habit-row-title-line {
  min-width: 0;
}

.habit-row h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
}

.habit-row-meta,
.habit-row-progress-value {
  margin: 3px 0 0;
  color: #716052;
  font-size: 0.86rem;
  font-weight: 800;
}

.habit-row-progress,
.habit-row-actions {
  position: relative;
  z-index: 2;
}

.habit-row-actions button {
  margin: 0;
  padding: 9px 12px;
  font-size: 0.82rem;
}

.selected-habit-panel {
  position: sticky;
  top: 24px;
  gap: 20px;
  padding: 24px;
}

.selected-habit-header h2 {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1;
}

.selected-habit-header p:last-child,
.selected-habit-empty p,
.habit-empty p {
  margin: 0;
  color: #716052;
}

.selected-habit-details {
  gap: 10px;
  margin: 0;
}

.selected-habit-details div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(132, 104, 75, 0.14);
  padding-top: 10px;
}

.selected-habit-details dt {
  color: #716052;
  font-weight: 900;
}

.selected-habit-details dd {
  margin: 0;
  font-weight: 950;
}

.habit-empty {
  padding: 56px 24px;
  text-align: center;
}

.habit-empty h3,
.selected-habit-empty h2 {
  margin: 0 0 8px;
}

.create-habit-panel {
  width: min(100%, 820px);
  margin: 0 auto;
}

.habit-form {
  gap: 18px;
  padding: 24px;
}

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

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

.habit-kind-fieldset {
  gap: 14px;
  margin: 0;
  border: 1px solid rgba(132, 104, 75, 0.22);
  border-radius: 20px;
  padding: 16px;
}

.habit-kind-fieldset legend {
  padding: 0 8px;
  font-weight: 950;
}

.habit-kind-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.habit-kind-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(132, 104, 75, 0.22);
  border-radius: 16px;
  padding: 12px;
  background: #fffaf3;
}

.habit-kind-option input {
  width: auto;
}

.habit-kind-fields {
  display: none;
}

.habit-kind-fieldset:has(#habit-kind-timer:checked) .timer-fields,
.habit-kind-fieldset:has(#habit-kind-pomodoro:checked) .pomodoro-fields {
  display: block;
}

@media (max-width: 520px) {
  body {
    align-items: stretch;
    padding: 16px;
  }

  .auth-card,
  .dashboard-card {
    align-self: center;
  }

  .dashboard-header,
  .workspace-list a,
  .stats-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }

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

  .selected-habit-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .dashboard-main {
    padding: 14px;
  }

  .habit-table-toolbar,
  .habit-panel-header {
    display: grid;
    align-items: stretch;
  }

  .habit-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .habit-form-grid,
  .pomodoro-form-grid,
  .habit-kind-options {
    grid-template-columns: 1fr;
  }
}

/* Old dashboard visual system restored from the previous Junti app. */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  font-family: inherit;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button:disabled {
  opacity: 0.7;
  pointer-events: none;
}

button,
.button-link {
  padding: 10px 14px;
  font-weight: 800;
  line-height: 1.2;
}

.secondary-button {
  margin-top: 0;
  border: 1px solid #cdbda9;
}

.dashboard-body {
  display: block;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 88% 12%, rgba(47, 109, 246, 0.08), transparent 24rem), #f7f7f4;
}

.dashboard-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.dashboard-sidebar {
  position: static;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 20px;
  padding: 28px 12px;
  border-right: 1px solid #e2dfd8;
  background: #f7f7f4;
  color: #24211d;
}

.brand {
  display: inline-flex;
  align-items: center;
  margin: 0 14px 10px;
  color: #24211d;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}

.dashboard-sidebar nav {
  gap: 6px;
}

.dashboard-sidebar nav a {
  border-radius: 8px;
  padding: 10px 12px;
  color: #716d66;
  font-size: 0.94rem;
}

.dashboard-sidebar nav a.active,
.dashboard-sidebar nav a:hover {
  background: #2f6df6;
  color: #fff;
}

.sidebar-user-email {
  color: #77726a;
}

.sidebar-user-card {
  min-width: 0;
  align-self: end;
  grid-template-columns: auto 1fr;
  border: 1px solid #ebe7df;
  border-radius: 8px;
  background: #fff;
  color: #24211d;
}

.sidebar-user-card:hover,
.sidebar-user-card.active {
  border-color: #d8d3c9;
  background: #fffaf3;
}

.sidebar-user-avatar {
  background: #efe9df;
  color: #24211d;
}

.sidebar-user-copy {
  display: grid;
  gap: 2px;
}

.sidebar-user-name {
  font-weight: 900;
}

.logout-form button {
  margin-top: 0;
  width: 100%;
  min-width: 112px;
  background: #211b16;
}

.dashboard-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow-y: auto;
}

.dashboard-main {
  width: auto;
  min-height: 0;
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0;
  align-items: stretch;
}

.habit-table-panel {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.habit-table-toolbar {
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #ebe7df;
}

.habit-table-toolbar h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.habit-table-toolbar time {
  display: block;
  margin-top: 6px;
  color: #716d66;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.habit-list-table {
  overflow-y: auto;
  display: grid;
  align-content: start;
}

.habit-list-section-header {
  padding: 14px 20px 6px;
  border-top: 1px solid #ebe7df;
  background: rgba(247, 245, 240, 0.7);
  color: #716d66;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.habit-row {
  grid-template-columns: minmax(0, 1fr) 72px 140px;
  gap: 14px;
  min-height: 76px;
  border-top: 0;
  border-bottom: 1px solid #ebe7df;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.7);
}

.habit-row-cover {
  cursor: pointer;
}

.habit-row.active {
  background: #f3f6ff;
  box-shadow: inset 3px 0 0 #2f6df6;
}

.habit-row:hover {
  background: #f8faff;
}

.habit-row.completed {
  background: rgba(246, 255, 242, 0.82);
  color: inherit;
}

.habit-row-link {
  position: relative;
  z-index: 2;
  grid-template-columns: auto minmax(0, 1fr);
  pointer-events: none;
}

.habit-row-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #c8c4bd;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  font-size: 0;
}

.habit-row-icon-today {
  border-color: #b1aca3;
}

.habit-row-icon-soon {
  border-color: #d6a40a;
}

.habit-row-icon-overdue {
  border-color: #c8392c;
  background: transparent;
}

.habit-row-icon-done {
  border-color: #2e6d18;
  background: #2e6d18;
}

.habit-row-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.habit-row-title-line h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.habit-row p {
  margin: 3px 0 0;
  color: #716d66;
  line-height: 1.45;
}

.habit-row-meta {
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-row-progress {
  display: grid;
  justify-items: end;
  min-width: 0;
  pointer-events: none;
  color: #716d66;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
  font-weight: 800;
}

.habit-row-progress-value {
  color: #24211d;
}

.habit-row-actions {
  z-index: 3;
  display: flex;
  justify-content: end;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: auto;
}

.habit-row-actions form {
  display: block;
}

.habit-row-actions button {
  margin-top: 0;
}

.selected-habit-panel {
  position: static;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 22px;
  border: 0;
  border-left: 1px solid #e2dfd8;
  border-radius: 0;
  padding: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.selected-habit-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.selected-habit-header p:not(.eyebrow),
.selected-habit-empty p {
  margin: 10px 0 0;
  color: #716d66;
}

.selected-habit-details {
  display: grid;
  gap: 12px;
  margin: 0;
}

.selected-habit-details div {
  display: grid;
  gap: 4px;
  border-top: 1px solid #ebe7df;
  padding-top: 12px;
}

.selected-habit-details dt,
.habit-activity dt {
  color: #9a4a20;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.selected-habit-details dd {
  margin: 0;
  color: #24211d;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.selected-habit-empty h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.2;
}

.habit-activity {
  display: grid;
  gap: 8px;
  border-top: 1px solid #ebe7df;
  padding-top: 16px;
}

.habit-activity-summary {
  margin: 0;
  color: #716d66;
  font-size: 0.84rem;
  font-weight: 700;
}

.habit-activity-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
}

.habit-activity-day {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: #ebe7df;
}

.habit-activity-day.completed {
  background: #2e6d18;
}

.empty-panel {
  min-height: min(58vh, 560px);
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid rgba(132, 104, 75, 0.24);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.92), rgba(255, 250, 243, 0.7)),
    radial-gradient(circle at bottom right, rgba(213, 121, 64, 0.18), transparent 22rem);
  box-shadow: 0 34px 90px rgba(64, 45, 27, 0.14);
}

.habit-panel {
  display: grid;
  gap: 24px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(132, 104, 75, 0.24);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.94), rgba(255, 250, 243, 0.76)),
    radial-gradient(circle at top right, rgba(213, 121, 64, 0.16), transparent 22rem);
  box-shadow: 0 34px 90px rgba(64, 45, 27, 0.14);
}

.habit-panel-header {
  align-items: start;
  padding: 0;
  border-bottom: 0;
}

.habit-panel-header h2 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.habit-kind-fieldset {
  border: 0;
  padding: 0;
}

.habit-kind-option {
  position: relative;
  display: grid;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 250, 243, 0.62);
  cursor: pointer;
}

.habit-kind-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.habit-kind-option:has(input:checked) {
  border-color: #b85f2e;
  background: #fff1eb;
  box-shadow: inset 0 0 0 1px rgba(184, 95, 46, 0.36);
}

.habit-kind-fields {
  display: none;
}

.habit-kind-fieldset:has(#habit-kind-timer:checked) .timer-fields,
.habit-kind-fieldset:has(#habit-kind-pomodoro:checked) .pomodoro-fields {
  display: grid;
}

.habit-empty {
  border: 1px dashed rgba(132, 104, 75, 0.34);
  border-radius: 22px;
  padding: 24px;
  background: rgba(255, 250, 243, 0.48);
}

.habit-table-panel > .habit-empty,
.habit-panel > .habit-empty {
  min-height: 180px;
  display: grid;
  align-content: center;
  border: 0;
  border-radius: 0;
  padding: 24px 20px;
  background: transparent;
}

.habit-form {
  margin-top: 8px;
  border-top: 1px solid rgba(132, 104, 75, 0.2);
  padding: 24px 0 0;
}

.create-habit-panel {
  width: 100%;
  min-height: 100%;
  max-width: none;
  align-content: start;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.create-habit-form {
  max-width: none;
  padding-bottom: clamp(32px, 6vh, 64px);
}

.habit-form-grid {
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 1fr) minmax(160px, 1.2fr);
  gap: 16px;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(24px, 5vw, 56px);
}

.dashboard-topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.groups-main {
  display: grid;
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}

.groups-panel {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid rgba(132, 104, 75, 0.24);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.92), rgba(255, 250, 243, 0.78));
  box-shadow: 0 18px 50px rgba(64, 45, 27, 0.08);
}

.groups-panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.groups-panel-header .muted {
  margin: 6px 0 0;
  color: #716052;
  font-size: 0.95rem;
  line-height: 1.5;
}

.groups-count {
  margin-left: 6px;
  color: #9a4a20;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.group-create-form {
  display: grid;
  gap: 12px;
  margin: 0;
}

.group-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.group-create-input {
  display: contents;
}

.group-create-input input {
  width: 100%;
  border: 1px solid #cdbda9;
  border-radius: 999px;
  padding: 11px 16px;
  background: #fffaf3;
  color: inherit;
  font: inherit;
}

.group-create-row button {
  margin-top: 0;
  padding: 10px 18px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.group-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(132, 104, 75, 0.18);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.7);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.group-row:hover {
  border-color: rgba(184, 95, 46, 0.45);
  background: rgba(255, 241, 235, 0.7);
  transform: translateY(-1px);
}

.group-row-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #211b16;
  color: #fffaf3;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  user-select: none;
}

.group-row-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.group-row-name {
  overflow: hidden;
  color: #211b16;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-row-meta {
  color: #716052;
  font-size: 0.84rem;
  line-height: 1.4;
}

.group-row-role {
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(154, 74, 32, 0.12);
  color: #9a4a20;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.group-row-arrow {
  color: #b85f2e;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.group-empty {
  border: 1px dashed rgba(132, 104, 75, 0.32);
  border-radius: 18px;
  padding: 18px 20px;
  background: rgba(255, 250, 243, 0.5);
  text-align: left;
}

.group-empty h3 {
  margin: 0;
  font-size: 1rem;
}

.group-empty p {
  margin: 6px 0 0;
  color: #716052;
  font-size: 0.95rem;
}

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

.group-member-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(132, 104, 75, 0.18);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.7);
}

.group-member-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.group-invite-form {
  display: grid;
  gap: 12px;
}

.group-invite-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.group-invite-input input {
  width: 100%;
}

.group-invite-row button {
  margin-top: 0;
}

.group-invitation-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.group-invitation-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px dashed rgba(132, 104, 75, 0.32);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.5);
}

.group-invite-accept-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.group-invite-accept-login {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(132, 104, 75, 0.22);
  border-radius: 18px;
  background: rgba(255, 250, 243, 0.65);
}

.group-invite-accept-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 760px) {
  .dashboard-shell {
    height: auto;
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .dashboard-body {
    overflow: auto;
    background:
      radial-gradient(circle at 88% 12%, rgba(184, 95, 46, 0.22), transparent 26rem),
      linear-gradient(135deg, #f8f0e4 0%, #efe3d3 48%, #f9f5ed 100%);
  }

  .dashboard-workspace {
    overflow: visible;
  }

  .dashboard-sidebar {
    height: auto;
    min-height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    border-right: 0;
  }

  .dashboard-content-grid,
  .habit-row,
  .habit-form-grid,
  .pomodoro-form-grid,
  .habit-kind-options,
  .group-create-row {
    grid-template-columns: 1fr;
  }

  .group-invite-row {
    grid-template-columns: 1fr;
  }

  .dashboard-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .group-row {
    grid-template-columns: auto 1fr auto;
  }

  .group-row-arrow {
    display: none;
  }

  .group-row-role {
    justify-self: end;
  }

  .selected-habit-panel {
    position: static;
    height: auto;
    border-left: 0;
    border-top: 1px solid #e2dfd8;
  }

  .habit-row {
    align-items: stretch;
  }

  .habit-row-progress {
    justify-items: start;
  }

  .habit-row-actions {
    display: grid;
    justify-content: stretch;
  }
}
