:root {
  color-scheme: light;
  --bg: #f8f9fd;
  --surface: #ffffff;
  --ink: #19213c;
  --muted: #68728e;
  --line: #e0e4f0;
  --purple: #7355e8;
  --purple-soft: #f3efff;
  --blue: #4878f0;
  --blue-soft: #f0f5ff;
  --red: #f35c67;
  --red-soft: #fff3f4;
  --orange: #f4a51d;
  --orange-soft: #fff8e9;
  --green: #30ab78;
  --green-soft: #f0fbf6;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-full: 8px;
  --shadow: 0 2px 8px rgba(32, 41, 90, 0.045);
  font-family:
    Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 75% 0%, rgba(115, 85, 232, 0.07), transparent 28rem),
    var(--bg);
}

.policy-page {
  width: min(760px, calc(100% - 32px));
  margin: 48px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 54px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.policy-page a {
  color: var(--purple);
  font-weight: 800;
  text-decoration: none;
}

.policy-page h1,
.policy-page h2 {
  letter-spacing: -0.03em;
}

.policy-page p {
  color: var(--muted);
  line-height: 1.9;
}

.privacy-link {
  margin-top: auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(115, 85, 232, 0.22);
  outline-offset: 2px;
}

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

.app-shell > * {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
}

.brand {
  display: grid;
  gap: 4px;
  color: var(--ink);
  text-decoration: none;
}

.brand span {
  font-size: 29px;
  font-weight: 950;
  letter-spacing: -1.5px;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 14px;
  color: #5f6a88;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.nav-item span {
  width: 22px;
  color: var(--purple);
  font-size: 19px;
  text-align: center;
}

.nav-item:hover,
.nav-item.active {
  border-color: #dcd2ff;
  color: var(--purple);
  background: var(--purple-soft);
}

.sidebar-points {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border: 1px solid #ddd7f5;
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--surface);
  text-align: center;
}

.sidebar-points > span,
.sidebar-points p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.sidebar-points strong {
  color: var(--purple);
  font-size: 34px;
  line-height: 1;
}

.sidebar-points strong small {
  margin-left: 5px;
  font-size: 12px;
}

.sidebar-quote {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  color: var(--muted);
  background: #f5f3fb;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.7;
  text-align: center;
}

main {
  width: min(1400px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.install-button {
  min-height: 42px;
  border: 1px solid #dcd2ff;
  border-radius: 11px;
  padding: 0 13px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.install-button:hover {
  color: white;
  background: var(--purple);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.account-button,
.sync-status {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 850;
}

.account-button {
  border: 1px solid #d9d2f7;
  padding: 0 12px;
  color: var(--purple);
  background: white;
  cursor: pointer;
}

.account-button.signed-in {
  color: white;
  background: var(--purple);
}

.sync-status {
  min-height: 28px;
  padding: 0 9px;
  color: var(--muted);
  background: #f1f2f6;
}

.sync-status.syncing {
  color: var(--orange);
  background: var(--orange-soft);
}

.sync-status.synced {
  color: var(--green);
  background: var(--green-soft);
}

.sync-status.error {
  color: var(--red);
  background: var(--red-soft);
}

.smart-add-card {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr);
  gap: 10px 20px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow);
}

.smart-add-copy {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--purple);
  font-size: 24px;
}

.smart-add-copy h2 {
  margin: 0;
  font-size: 14px;
}

.smart-add-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.smart-add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid #d9ddea;
  border-radius: 11px;
}

.smart-add-form:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(115, 85, 232, 0.1);
}

.smart-add-form input {
  min-width: 0;
  height: 46px;
  border: 0;
  padding: 0 14px;
  color: var(--ink);
  background: white;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 17px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: white;
  background: var(--purple);
  box-shadow: 0 1px 3px rgba(67, 45, 150, 0.16);
}

.button.ghost {
  border-color: var(--line);
  background: white;
}

.button.danger {
  border-color: #ffd0d4;
  color: var(--red);
  background: white;
}

.smart-add-form .button {
  border-radius: 0;
}

.date-shortcuts {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.date-shortcuts span {
  overflow: hidden;
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-shortcuts button,
.modal-shortcuts button {
  min-height: 27px;
  border: 1px solid #ddd7f5;
  border-radius: var(--radius-full);
  padding: 0 10px;
  color: var(--purple);
  background: #faf8ff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.date-shortcuts button.selected,
.date-shortcuts button:hover,
.modal-shortcuts button:hover {
  color: white;
  background: var(--purple);
}

.onboarding-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-color: #ddd7fa;
  background: #fbfbfd;
}

.onboarding-card[hidden] {
  display: none;
}

.onboarding-copy h2,
.onboarding-copy p {
  margin: 0;
}

.onboarding-copy h2 {
  margin-top: 2px;
  font-size: 17px;
}

.onboarding-copy > p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.onboarding-actions button,
.section-toggle {
  min-height: 34px;
  border: 1px solid #d9d2f7;
  border-radius: var(--radius-full);
  padding: 0 12px;
  color: var(--purple);
  background: white;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.onboarding-actions button:hover {
  color: white;
  background: var(--purple);
}

.onboarding-actions .onboarding-dismiss {
  color: var(--muted);
  border-color: var(--line);
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.collapsible-content {
  display: grid;
  gap: 10px;
}

.section-toggle {
  display: none;
}

.daily-panel {
  display: grid;
  gap: 10px;
  padding: 15px;
  background: var(--surface);
}

.daily-heading {
  justify-content: space-between;
}

.daily-progress {
  min-width: 52px;
  border-radius: var(--radius-full);
  padding: 7px 10px;
  color: var(--orange);
  background: var(--orange-soft);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.daily-lead {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.65;
}

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

.daily-card {
  display: grid;
  gap: 8px;
  border: 1px solid #f2dfb6;
  border-radius: 13px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.daily-card.done {
  border-color: #bee9d6;
  background: color-mix(in srgb, var(--green) 4%, white);
}

.daily-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 7px rgba(32, 41, 90, 0.05);
}

.daily-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.daily-badge {
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: #9c6400;
  background: var(--orange-soft);
  font-size: 9px;
  font-weight: 950;
}

.daily-card.done .daily-badge {
  color: var(--green);
  background: var(--green-soft);
}

.daily-check {
  min-height: 28px;
  border: 1px solid #ead7ad;
  border-radius: var(--radius-full);
  padding: 0 10px;
  color: var(--orange);
  background: white;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.daily-card.done .daily-check {
  border-color: #b9e5d1;
  color: white;
  background: var(--green);
}

.daily-card h3 {
  margin: 0;
  font-size: 13px;
}

.daily-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

.daily-card textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid #e5dfcf;
  border-radius: 10px;
  padding: 10px;
  color: var(--ink);
  background: #fffdf8;
  font-size: 11px;
  line-height: 1.55;
}

.daily-card textarea::placeholder {
  color: #a6a092;
}

.external-panel {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.external-heading {
  justify-content: space-between;
}

.external-lead,
.external-note,
.external-status {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.65;
}

.news-sites-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
}

.news-sites-heading h3 {
  margin: 0;
  font-size: 12px;
}

.news-sites-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.news-sites-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.news-site-card {
  position: relative;
  min-height: 92px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  border: 1px solid #dfe3ef;
  border-radius: 12px;
  padding: 11px;
  color: var(--ink);
  background: white;
  text-decoration: none;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.news-site-card:hover {
  transform: translateY(-2px);
  border-color: var(--site-color, var(--blue));
  box-shadow: 0 2px 7px rgba(32, 41, 90, 0.05);
}

.news-site-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--site-color, var(--blue));
  font-size: 11px;
  font-weight: 950;
}

.news-site-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.news-site-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-site-copy small {
  color: var(--site-color, var(--blue));
  font-size: 8px;
  font-weight: 900;
}

.news-site-copy .news-site-access {
  border-radius: var(--radius-sm);
  padding: 2px 5px;
  color: var(--green);
  background: var(--green-soft);
  white-space: nowrap;
}

.news-site-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-site-copy > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.45;
}

.news-site-open {
  color: var(--site-color, var(--blue));
  font-size: 13px;
  font-weight: 950;
}

.news-site-card[data-tone="navy"] {
  --site-color: #273c75;
}

.news-site-card[data-tone="purple"] {
  --site-color: #6b49c8;
}

.news-site-card[data-tone="red"] {
  --site-color: #d64550;
}

.news-site-card[data-tone="pink"] {
  --site-color: #d62669;
}

.news-site-card[data-tone="blue"] {
  --site-color: #3675df;
}

.news-site-card[data-tone="teal"] {
  --site-color: #167f86;
}

.news-site-card[data-tone="green"] {
  --site-color: #279363;
}

.news-site-card[data-tone="orange"] {
  --site-color: #d87b16;
}

.external-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.external-tabs button {
  min-height: 30px;
  border: 1px solid #d8e1fb;
  border-radius: var(--radius-full);
  padding: 0 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.external-tabs button.active,
.external-tabs button:hover {
  color: white;
  background: var(--blue);
}

.external-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.external-item {
  min-height: 118px;
  display: grid;
  gap: 10px;
  border: 1px solid #d9e2fb;
  border-radius: 12px;
  padding: 12px;
  background: #f8faff;
}

.external-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
}

.external-item h3 {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.external-item a {
  align-self: end;
  justify-self: start;
  border-radius: var(--radius-full);
  padding: 6px 10px;
  color: white;
  background: var(--blue);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.external-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  border: 1px dashed #cfd9f5;
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcff;
  text-align: center;
}

.external-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.external-empty span {
  font-size: 10px;
  font-weight: 750;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 18px rgba(32, 41, 90, 0.035);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(420px, 1.75fr) minmax(230px, 0.78fr);
  gap: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.3px;
}

.panel-kicker {
  margin: 0 0 3px;
  color: var(--purple);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-card {
  padding: 16px;
}

.calendar-card .panel-heading h2 {
  flex: 1;
  text-align: center;
}

.calendar-arrow,
.today-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}

.calendar-arrow {
  font-size: 20px;
}

.today-button {
  border-radius: 8px;
  padding: 6px 8px;
  background: #f3f4f8;
  font-size: 10px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekdays {
  margin: 14px 0 5px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.calendar-weekdays span:first-child {
  color: var(--red);
}

.calendar-weekdays span:last-child {
  color: var(--blue);
}

.calendar-day {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.calendar-day:hover {
  background: var(--purple-soft);
}

.calendar-day.outside {
  color: #c6cad6;
}

.calendar-day.current {
  color: white;
  background: var(--purple);
  font-weight: 900;
}

.calendar-day.selected:not(.current) {
  color: var(--purple);
  background: var(--purple-soft);
  font-weight: 900;
}

.calendar-dots {
  position: absolute;
  bottom: 1px;
  display: flex;
  gap: 2px;
}

.calendar-dots i,
.dot {
  width: 5px;
  height: 5px;
  display: inline-block;
  border-radius: 50%;
}

.dot.overdue {
  background: var(--red);
}

.dot.today {
  background: var(--orange);
}

.dot.upcoming {
  background: var(--blue);
}

.dot.completed {
  background: var(--green);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.calendar-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.focus-card {
  --focus-color: var(--orange);
  min-height: 310px;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-color: color-mix(in srgb, var(--focus-color) 42%, white);
  background: color-mix(in srgb, var(--focus-color) 3%, white);
}

.focus-card.overdue {
  --focus-color: var(--red);
}

.focus-card.upcoming {
  --focus-color: var(--blue);
}

.focus-card .panel-heading {
  color: var(--focus-color);
}

.focus-task {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--focus-color) 30%, white);
  border-radius: 13px;
  padding: 16px;
  background: white;
}

.focus-symbol {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 4px solid color-mix(in srgb, var(--focus-color) 18%, white);
  border-radius: 10px;
  color: white;
  background: var(--focus-color);
  font-size: 28px;
}

.focus-task h2 {
  margin: 0;
  font-size: 21px;
}

.focus-task .course {
  display: block;
  margin: 5px 0 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.focus-deadline {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.remaining {
  display: inline-flex;
  margin-left: 7px;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--focus-color);
  background: color-mix(in srgb, var(--focus-color) 11%, white);
  font-size: 9px;
  font-weight: 900;
}

.focus-step {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--focus-color) 25%, white);
  border-radius: 11px;
  padding: 12px 14px;
  background: white;
}

.focus-step span {
  color: var(--focus-color);
  font-size: 20px;
}

.focus-step small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.focus-step strong {
  font-size: 12px;
}

.focus-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 8px;
}

.focus-actions .complete-button {
  color: white;
  background: var(--green);
}

.focus-empty {
  min-height: 270px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.focus-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 20px;
}

.ai-panel {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.ai-panel .panel-heading {
  justify-content: space-between;
}

.api-status {
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--muted);
  background: #f1f2f6;
  font-size: 8px;
  font-weight: 900;
}

.api-status.online {
  color: var(--green);
  background: var(--green-soft);
}

.ai-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  border: 1px solid #ddd7f5;
  border-radius: 13px;
  padding: 14px;
  background: #faf9fd;
}

.ai-spark {
  color: var(--purple);
  font-size: 22px;
}

.ai-result strong {
  font-size: 13px;
  line-height: 1.55;
}

.ai-result p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.65;
}

.ai-result .suggested-step {
  margin-top: auto;
  border-radius: 9px;
  padding: 8px 9px;
  color: var(--purple);
  background: white;
  font-size: 10px;
  font-weight: 850;
}

.ai-button {
  color: white;
  background: var(--purple);
}

.privacy-note {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.week-panel {
  padding: 15px;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
}

.week-item {
  min-height: 91px;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: white;
}

.week-item time {
  color: var(--purple);
  font-size: 9px;
  font-weight: 900;
}

.week-item strong {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.week-item span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.week-item.empty {
  place-content: center;
  color: #a8afc0;
  text-align: center;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.board-column {
  --column-color: var(--blue);
  min-height: 290px;
  border: 1px solid color-mix(in srgb, var(--column-color) 23%, white);
  border-radius: 14px;
  padding: 10px;
  background: color-mix(in srgb, var(--column-color) 4%, white);
}

.overdue-column {
  --column-color: var(--red);
}

.today-column {
  --column-color: var(--orange);
}

.upcoming-column {
  --column-color: var(--blue);
}

.completed-column {
  --column-color: var(--green);
}

.board-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--column-color);
}

.board-heading h2 {
  margin: 0;
  font-size: 12px;
}

.board-heading span {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: 8px;
  font-weight: 900;
}

.board-list {
  display: grid;
  align-content: start;
  gap: 7px;
}

.task-card {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--column-color) 20%, white);
  border-radius: 10px;
  padding: 10px;
  background: white;
  box-shadow: 0 2px 7px rgba(32, 41, 90, 0.035);
}

.task-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.task-card h3 {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.task-card-menu {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.task-card-course {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.task-card-deadline {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.task-card-deadline strong {
  color: var(--column-color);
}

.task-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 2px;
}

.task-card-actions button {
  min-height: 29px;
  border: 1px solid color-mix(in srgb, var(--column-color) 35%, white);
  border-radius: 7px;
  color: var(--column-color);
  background: white;
  font-size: 8px;
  font-weight: 850;
  cursor: pointer;
}

.task-card-actions button:first-child {
  color: white;
  background: var(--column-color);
}

.board-empty {
  padding: 28px 8px;
  color: #a3a9ba;
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}

.modal {
  width: min(620px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  overflow: auto;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 24px;
  color: var(--ink);
  background: white;
  box-shadow: 0 14px 38px rgba(25, 33, 60, 0.16);
}

.modal::backdrop {
  background: rgba(25, 33, 60, 0.38);
  backdrop-filter: blur(3px);
}

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

.modal-heading h2 {
  margin: 0;
  font-size: 22px;
}

.modal form {
  display: grid;
  gap: 16px;
}

.modal label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
}

.modal [hidden] {
  display: none;
}

.modal label small {
  color: var(--muted);
  font-size: 9px;
}

.modal input {
  width: 100%;
  height: 45px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  color: var(--ink);
  background: #fbfbfe;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.modal-shortcuts span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.modal-spacer {
  flex: 1;
}

.history-list {
  display: grid;
  gap: 8px;
}

.backup-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.8;
}

.backup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-modal {
  width: min(500px, calc(100vw - 28px));
}

.account-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f1fa;
}

.account-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.account-tabs button.active {
  color: var(--purple);
  background: white;
  box-shadow: 0 1px 4px rgba(32, 41, 90, 0.06);
}

#account-form {
  display: grid;
  gap: 12px;
}

.account-help,
.account-error,
.recovery-result p,
.account-profile p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.65;
}

.account-error {
  min-height: 16px;
  color: var(--red);
}

.account-submit {
  width: 100%;
}

.recovery-result {
  display: grid;
  gap: 11px;
  border: 1px solid #e0d7ff;
  border-radius: 14px;
  padding: 16px;
  background: #faf8ff;
}

.recovery-result[hidden] {
  display: none;
}

.recovery-result code {
  overflow-wrap: anywhere;
  border-radius: 9px;
  padding: 12px;
  color: var(--purple);
  background: white;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.account-signed-in {
  display: grid;
  gap: 14px;
}

.account-signed-in[hidden] {
  display: none;
}

.account-profile {
  display: grid;
  gap: 5px;
  border: 1px solid #dfe3ef;
  border-radius: 14px;
  padding: 16px;
  background: #fafbff;
}

.account-profile span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.account-profile strong {
  font-size: 18px;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.account-actions #logout-button {
  grid-column: 1 / -1;
}

.sync-history {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.sync-history[hidden] {
  display: none;
}

.sync-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fbfbfe;
}

.sync-history-item span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.sync-history-item button {
  min-height: 30px;
  border: 1px solid #d9d2f7;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--purple);
  background: white;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}

.password-modal {
  width: min(460px, calc(100vw - 28px));
}

.password-modal form {
  display: grid;
  gap: 12px;
}

.password-modal form[hidden] {
  display: none;
}

.ad-shell {
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.ad-shell[hidden] {
  display: none;
}

.ad-shell > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

#ad-content {
  width: 100%;
}

.sync-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sync-choice {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #dfe3ef;
  border-radius: 14px;
  padding: 16px;
  color: var(--ink);
  background: white;
  text-align: left;
  cursor: pointer;
}

.sync-choice:hover {
  border-color: var(--purple);
  background: #faf8ff;
}

.sync-choice span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  background: #fafbfe;
}

.history-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
}

.history-item span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 22px;
  min-width: 230px;
  max-width: calc(100% - 30px);
  border-radius: 10px;
  padding: 11px 15px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  z-index: 60;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.celebration {
  position: fixed;
  z-index: 40;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall 900ms ease-out forwards;
}

@keyframes confetti-fall {
  to {
    transform: translate(var(--x), 105vh) rotate(var(--r));
    opacity: 0.8;
  }
}

body.dim {
  filter: saturate(0.82);
}

.native-app .toast {
  bottom: calc(22px + env(safe-area-inset-bottom));
}

@media (max-width: 850px) {
  .native-app .sidebar {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .native-app main {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 1180px) {
  .news-sites-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(240px, 0.8fr) minmax(410px, 1.4fr);
  }

  .ai-panel {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .task-board {
    grid-template-columns: repeat(4, 260px);
  }
}

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

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    padding: 14px;
  }

  .brand small,
  .sidebar-points,
  .sidebar-quote {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 5px;
    min-width: 0;
    overflow-x: auto;
  }

  .nav-item {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0;
  }

  .nav-item span {
    font-size: 17px;
  }

  main {
    padding: 14px;
  }

  .smart-add-card {
    grid-template-columns: 1fr;
  }

  .sync-status {
    display: none;
  }

  .onboarding-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .onboarding-actions {
    justify-content: flex-start;
  }

  .section-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .collapsible-section.collapsed .collapsible-content {
    display: none;
  }

  .date-shortcuts {
    grid-column: 1;
    overflow-x: auto;
  }

  .date-shortcuts span {
    min-width: 130px;
  }

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

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

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

  .calendar-day {
    width: 36px;
    height: 36px;
    aspect-ratio: auto;
    justify-self: center;
  }

  .ai-panel {
    grid-column: auto;
  }

  .task-board {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .board-column {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .topbar > div:first-child p {
    display: none;
  }

  .topbar-actions {
    gap: 4px;
  }

  .account-button {
    max-width: 92px;
    overflow: hidden;
    padding: 0 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .icon-button {
    width: 38px;
    height: 38px;
  }

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

  .news-sites-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .smart-add-form {
    grid-template-columns: 1fr;
  }

  .smart-add-form .button {
    min-height: 38px;
  }

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

  .focus-symbol {
    width: 52px;
    height: 52px;
    border-width: 5px;
    font-size: 21px;
  }

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

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

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

  .account-tabs,
  .account-actions,
  .sync-choice-grid {
    grid-template-columns: 1fr;
  }
}

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

/* Sharper product UI: keep the existing layout while reducing soft, pill-like styling. */
body {
  background:
    radial-gradient(circle at 75% 0%, rgba(115, 85, 232, 0.035), transparent 28rem),
    #f7f8fa;
}

main {
  gap: 14px;
}

.policy-page,
.smart-add-card,
.panel,
.modal {
  border-radius: var(--radius-lg);
}

.panel,
.smart-add-card,
.policy-page {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.button,
.install-button,
.icon-button,
.account-button,
.sync-status,
.nav-item,
.smart-add-form,
.modal input,
.daily-card textarea,
.today-button,
.week-item,
.task-card,
.history-item,
.sync-history-item,
.sync-history-item button {
  border-radius: var(--radius-md);
}

.button:hover,
.daily-card:hover,
.news-site-card:hover {
  transform: none;
}

.button.primary {
  background: var(--purple);
  box-shadow: 0 1px 3px rgba(67, 45, 150, 0.16);
}

.sidebar-points {
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.sidebar-quote {
  border-radius: var(--radius-md);
  background: #f3f4f7;
}

.section-icon,
.news-site-mark {
  border-radius: var(--radius-md);
  background-image: none;
}

.section-icon {
  background-color: var(--purple);
}

.date-shortcuts button,
.modal-shortcuts button,
.onboarding-actions button,
.section-toggle,
.daily-progress,
.daily-badge,
.daily-check,
.news-site-copy .news-site-access,
.external-tabs button,
.external-item a,
.remaining,
.api-status {
  border-radius: var(--radius-full);
}

.onboarding-card {
  background: #fbfbfd;
}

.daily-panel {
  background: var(--surface);
}

.daily-card {
  border-radius: 10px;
  background: var(--surface);
}

.daily-card.done {
  background: color-mix(in srgb, var(--green) 4%, white);
}

.daily-card:hover,
.news-site-card:hover {
  box-shadow: 0 2px 7px rgba(32, 41, 90, 0.05);
}

.news-site-card,
.external-item,
.external-empty {
  border-radius: var(--radius-md);
}

.external-item {
  background: #f8faff;
}

.dashboard-grid {
  gap: 14px;
}

.calendar-day {
  border-radius: 7px;
}

.focus-card {
  background: color-mix(in srgb, var(--focus-color) 3%, white);
}

.focus-task,
.ai-result {
  border-radius: 10px;
}

.focus-symbol {
  border-width: 4px;
  border-radius: 10px;
}

.focus-step {
  border-radius: var(--radius-md);
}

.ai-result {
  background: #faf9fd;
}

.ai-button {
  background: var(--purple);
}

.board-column {
  border-radius: 10px;
  background: color-mix(in srgb, var(--column-color) 2.5%, white);
}

.board-heading span {
  border-radius: var(--radius-sm);
}

.modal {
  box-shadow: 0 14px 38px rgba(25, 33, 60, 0.16);
}

.account-tabs {
  border-radius: var(--radius-md);
  background: #f1f2f5;
}

.account-tabs button {
  border-radius: var(--radius-sm);
}

.account-tabs button.active {
  box-shadow: 0 1px 4px rgba(32, 41, 90, 0.06);
}

.recovery-result,
.account-profile,
.ad-shell,
.sync-choice {
  border-radius: 10px;
}

.recovery-result code {
  border-radius: var(--radius-md);
}

.toast {
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(25, 33, 60, 0.16);
}

/* Task workflow extensions */
.ideas-panel {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.ideas-panel .panel-heading {
  justify-content: space-between;
}

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

.idea-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
}

.idea-card-heading,
.external-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.idea-card h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.idea-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.idea-card dl div {
  display: grid;
  gap: 2px;
  border-top: 1px solid #edf0f6;
  padding-top: 7px;
}

.idea-card dt {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
}

.idea-card dd {
  margin: 0;
  color: #3f4966;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

.idea-card > a {
  color: var(--purple);
  font-size: 9px;
  font-weight: 850;
  text-decoration: none;
}

.idea-status,
.priority-tag,
.recurrence-tag {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  color: var(--muted);
  background: #f7f8fa;
  font-size: 8px;
  font-weight: 900;
}

.idea-status.researching,
.priority-tag.high {
  border-color: #f5c7cb;
  color: #c94752;
  background: #fff7f7;
}

.idea-status.testing {
  border-color: #c8dfd4;
  color: #21855d;
  background: #f5fbf8;
}

.priority-tag.low {
  color: #63708f;
}

.task-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.task-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) repeat(3, minmax(110px, 0.7fr)) auto;
  gap: 9px;
  align-items: end;
  padding: 12px;
}

.task-tools label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.task-tools input,
.task-tools select,
.modal select,
.modal textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #fbfbfe;
  font: inherit;
}

.task-tools input,
.task-tools select,
.modal select {
  height: 39px;
  padding: 0 10px;
}

.modal textarea {
  min-height: 82px;
  padding: 10px;
  line-height: 1.55;
  resize: vertical;
}

.task-search {
  position: relative;
}

.task-search > span {
  position: absolute;
  z-index: 1;
  left: 11px;
  bottom: 10px;
  color: var(--muted);
}

.task-search input {
  padding-left: 30px;
}

.external-item-actions {
  align-self: end;
  justify-content: flex-start;
}

.external-item-actions button {
  border: 1px solid #cdd8f7;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--blue);
  background: white;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}

.toggle-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
}

.toggle-row > span {
  display: grid;
  gap: 3px;
}

.toggle-row small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.notification-status,
.danger-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px;
  color: var(--muted);
  background: #f8f9fb;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.6;
}

.danger-panel {
  border-color: #f3c8cc;
  color: #91353d;
  background: #fff7f7;
}

.danger-panel p {
  margin: 5px 0 0;
}

.danger-copy {
  color: var(--red);
}

.account-actions #open-delete-account-button {
  grid-column: 1 / -1;
}

@media (max-width: 1000px) {
  .idea-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-tools {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(110px, 0.6fr));
  }

  .task-tools label:nth-of-type(4),
  .task-tools > button {
    grid-row: 2;
  }
}

@media (max-width: 650px) {
  .idea-list,
  .task-tools {
    grid-template-columns: 1fr;
  }

  .task-tools label:nth-of-type(4),
  .task-tools > button {
    grid-row: auto;
  }

  .task-tools > button {
    width: 100%;
  }
}

/* Start-now workflow */
#dashboard > .topbar {
  order: 0;
}

#dashboard > .focus-primary {
  order: 1;
}

#dashboard > .smart-add-card {
  order: 2;
}

#dashboard > .onboarding-card {
  order: 3;
}

#dashboard > .urgent-panel {
  order: 4;
}

#dashboard > .dashboard-grid {
  order: 5;
}

#dashboard > .week-panel {
  order: 6;
}

#dashboard > .task-tools {
  order: 7;
}

#dashboard > .task-board {
  order: 8;
}

#dashboard > .daily-panel {
  order: 9;
}

#dashboard > .ideas-panel {
  order: 10;
}

#dashboard > .external-panel {
  order: 11;
}

#dashboard > .ad-shell {
  order: 12;
}

.dashboard-grid {
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
}

.focus-primary {
  min-height: 0;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  align-items: stretch;
}

.focus-primary .panel-heading,
.focus-primary .focus-actions {
  grid-column: 1 / -1;
}

.focus-primary .focus-task,
.focus-primary .focus-step {
  grid-column: 1;
}

.focus-primary .focus-timer {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.focus-primary .focus-empty {
  grid-column: 1 / -1;
  min-height: 140px;
}

.focus-pin-button {
  margin-left: auto;
  border: 1px solid color-mix(in srgb, var(--focus-color) 40%, white);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--focus-color);
  background: white;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}

.focus-timer {
  display: grid;
  align-content: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--focus-color) 26%, white);
  border-radius: var(--radius-md);
  padding: 14px;
  background: white;
}

.focus-timer > div:first-child {
  display: grid;
  gap: 5px;
}

.focus-timer small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.focus-timer strong {
  color: var(--ink);
  font-size: 16px;
}

.focus-timer-countdown {
  color: var(--focus-color) !important;
  font-size: clamp(34px, 5vw, 52px) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.timer-duration-actions,
.timer-control-actions,
.timer-finish-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.timer-control-actions {
  grid-template-columns: 1fr 1fr;
}

.timer-finish-actions {
  grid-template-columns: repeat(5, minmax(48px, 1fr));
}

.focus-timer button {
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--focus-color) 34%, white);
  border-radius: var(--radius-sm);
  color: var(--focus-color);
  background: white;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.focus-timer button:hover,
.focus-timer .complete {
  color: white;
  background: var(--focus-color);
}

.focus-timer.finished {
  border-color: #bddfce;
  background: #f5fbf8;
}

.urgent-panel {
  display: grid;
  gap: 12px;
  padding: 15px;
}

.urgent-heading {
  justify-content: space-between;
}

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

.urgent-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
  background: #fbfbfd;
}

.urgent-group.overdue {
  border-color: #f2c9cd;
  background: #fffafa;
}

.urgent-group.today {
  border-color: #f0d8ac;
  background: #fffdf8;
}

.urgent-group.unscheduled {
  border-color: #d7dcef;
  background: #fafbff;
}

.urgent-group-heading {
  display: flex;
  align-items: center;
  gap: 6px;
}

.urgent-group-heading h3 {
  margin: 0;
  font-size: 11px;
}

.urgent-group-heading span {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: 8px;
  font-weight: 900;
}

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

.urgent-task {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px;
  background: white;
}

.urgent-task > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.urgent-task strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.urgent-task span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.urgent-task-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 5px;
}

.urgent-task-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: white;
  font-size: 8px;
  font-weight: 850;
  cursor: pointer;
}

.urgent-task-actions .complete {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.urgent-empty {
  padding: 18px 6px;
  color: #9ca4b8;
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}

.task-card-actions {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
}

.collapsible-section.collapsed .collapsible-content {
  display: none;
}

.external-panel .section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast button {
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  color: white;
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1.2fr);
  }

  .ai-panel {
    grid-column: auto;
  }
}

@media (max-width: 850px) {
  .focus-primary,
  .urgent-grid {
    grid-template-columns: 1fr;
  }

  .focus-primary .panel-heading,
  .focus-primary .focus-task,
  .focus-primary .focus-step,
  .focus-primary .focus-timer,
  .focus-primary .focus-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .focus-primary {
    padding: 14px;
  }

  .focus-primary .focus-task {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 12px;
  }

  .focus-primary .focus-symbol {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .focus-primary .focus-actions {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .timer-finish-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .focus-pin-button {
    max-width: 112px;
  }

  .toast {
    width: calc(100% - 28px);
    justify-content: space-between;
  }
}
