:root {
  color: #172033;
  background: #f6f7f9;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 247, 249, 0.96)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1800&q=80");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(246, 247, 249, 0.92);
  padding: 20px;
  backdrop-filter: blur(14px);
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid rgba(143, 154, 179, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.16);
  padding: 24px;
}

.login-panel h1 {
  margin-bottom: 22px;
  font-size: clamp(2rem, 10vw, 3.4rem);
}

.login-panel button {
  width: 100%;
}

.login-panel button {
  min-height: 44px;
  margin-top: 10px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  font-weight: 900;
}

.login-error {
  min-height: 22px;
  margin: 10px 0 0;
  color: #b42318;
  font-weight: 800;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.panel-heading,
.capture-actions,
.timer-actions,
.activity-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #60708f;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: #0f172a;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.1;
}

h3 {
  margin-bottom: 12px;
  color: #3b465c;
  font-size: 0.95rem;
}

.hero-grid,
.dashboard-grid,
.lower-grid {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  margin-top: 16px;
}

.lower-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  margin-top: 16px;
}

.capture-panel,
.focus-panel,
.todo-panel,
.pomodoro-panel,
.log-panel,
.insight-panel {
  border: 1px solid rgba(143, 154, 179, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.capture-panel {
  min-height: 320px;
  padding: 22px;
}

.focus-panel,
.todo-panel,
.pomodoro-panel,
.log-panel,
.insight-panel {
  padding: 18px;
}

.timestamp {
  border-radius: 999px;
  background: #edf6f2;
  color: #21725c;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 190px;
  margin: 22px 0 14px;
  padding: 16px;
  resize: vertical;
  border: 1px solid #d8deea;
  border-radius: 8px;
  outline: none;
  background: #fbfcfe;
  color: #172033;
  line-height: 1.55;
}

textarea:focus,
input:focus,
select:focus {
  border-color: #3d7b6f;
  box-shadow: 0 0 0 3px rgba(61, 123, 111, 0.16);
}

.capture-actions span {
  color: #6b7891;
  font-weight: 800;
}

.capture-actions button,
.todo-form button,
.timer-actions button,
.icon-button,
.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
}

.icon-button.wide {
  min-width: 120px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  background: #eef3f7;
  color: #4b5870;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
}

.sync-status[data-state="ok"] {
  background: #e2f4ea;
  color: #217149;
}

.sync-status[data-state="warn"] {
  background: #fff1d8;
  color: #8a520b;
}

.focus-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.focus-item,
.tag-strip button {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  background: #eef3f7;
  color: #263349;
  padding: 12px;
  text-align: left;
}

.focus-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.todo-form,
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.todo-form {
  margin: 18px 0;
}

input,
select {
  min-height: 42px;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fbfcfe;
  color: #172033;
  padding: 0 12px;
  outline: none;
}

.todo-form input {
  min-width: 0;
  flex: 1;
}

.todo-form select {
  width: 110px;
}

.todo-form button {
  width: 44px;
  padding: 0;
}

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

.todo-column {
  min-height: 220px;
  border-radius: 8px;
  background: #f7f9fc;
  padding: 14px;
}

.todo-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 8px;
  margin-bottom: 9px;
  color: #202c40;
}

.todo-row span {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.todo-row.done span {
  color: #8792a6;
  text-decoration: line-through;
}

.todo-row button,
.memo-card button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: #59677f;
}

.pomodoro-panel {
  display: flex;
  flex-direction: column;
}

.timer {
  margin: 28px 0 20px;
  color: #0f172a;
  font-size: clamp(3.4rem, 8vw, 6.5rem);
  font-weight: 900;
  line-height: 0.9;
  text-align: center;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border-radius: 8px;
  background: #e7edf5;
  padding: 6px;
}

.segmented button,
.tag-strip button {
  min-height: 36px;
  font-size: 0.86rem;
  font-weight: 800;
}

.segmented button {
  border-radius: 7px;
  background: transparent;
  color: #55647a;
}

.segmented button.active,
.tag-strip button.active {
  background: #ffffff;
  color: #172033;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.timer-actions {
  margin-top: auto;
  padding-top: 20px;
}

.timer-actions button {
  flex: 1;
}

.search-box {
  width: min(260px, 45%);
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fbfcfe;
  padding-left: 10px;
}

.search-box input {
  width: 100%;
  border: 0;
  background: transparent;
  padding-left: 0;
}

.search-box input:focus {
  box-shadow: none;
}

.tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.memo-list {
  display: grid;
  max-height: 560px;
  overflow: auto;
  gap: 10px;
  padding-right: 4px;
}

.memo-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 28px;
  gap: 12px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.memo-card time {
  color: #547066;
  font-weight: 900;
}

.memo-card p {
  margin-bottom: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.48;
}

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

.stat-grid div {
  border-radius: 8px;
  background: #f0f5f2;
  padding: 14px 10px;
}

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

.stat-grid strong {
  font-size: 1.75rem;
  line-height: 1;
}

.stat-grid span {
  margin-top: 6px;
  color: #66738a;
  font-size: 0.82rem;
  font-weight: 800;
}

.activity-title {
  justify-content: flex-start;
  margin: 18px 0 10px;
  color: #435066;
  font-weight: 900;
}

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

.activity-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  background: #e5eaf1;
}

.level-1 {
  background: #b9dfcc;
}

.level-2 {
  background: #72bd93;
}

.level-3 {
  background: #3d9b6c;
}

.level-4 {
  background: #207149;
}

.reset-button {
  width: 100%;
  margin-top: 18px;
  background: #e9eef6;
  color: #2b3547;
}

.empty {
  margin: 0;
  color: #8792a6;
  font-weight: 700;
}

@media (max-width: 1080px) {
  .hero-grid,
  .dashboard-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 16px;
  }

  .topbar,
  .panel-heading,
  .capture-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .todo-columns,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .todo-form,
  .timer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .todo-form select,
  .search-box {
    width: 100%;
  }

  .todo-form button {
    width: 100%;
  }

  .memo-card {
    grid-template-columns: 1fr 28px;
  }

  .memo-card time {
    grid-column: 1 / -1;
  }
}
