:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --paper-deep: #e9e2d7;
  --ink: #1d2b26;
  --ink-soft: #66716c;
  --line: rgba(29, 43, 38, 0.13);
  --green: #1f5947;
  --green-bright: #d7e7b5;
  --coral: #e66d4e;
  --white: #fffdf8;
  --shadow: 0 20px 60px rgba(39, 47, 42, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 8%, rgba(215, 231, 181, 0.64), transparent 28rem),
    radial-gradient(circle at 6% 52%, rgba(230, 109, 78, 0.08), transparent 24rem),
    var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(230, 109, 78, 0.35);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-150%);
}

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

.app-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.app-menu-bar {
  position: sticky;
  z-index: 25;
  top: 12px;
  display: flex;
  width: fit-content;
  margin: 14px 0 0 auto;
  padding: 5px;
  align-items: center;
  gap: 6px;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 32px rgba(39, 47, 42, 0.09);
  backdrop-filter: blur(14px);
}

.view-tabs {
  display: flex;
  gap: 3px;
}

.view-tab {
  display: flex;
  min-height: 40px;
  padding: 0 14px;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 780;
  cursor: pointer;
}

.view-tab[aria-selected="true"] {
  color: var(--white);
  background: var(--green);
}

.view-tab svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-view {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
}

.auth-card {
  width: min(430px, 100%);
  padding: 36px;
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 30px;
  place-items: center;
  color: var(--paper);
  background: var(--green);
  border-radius: 14px;
}

.auth-mark svg {
  width: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.auth-card h1 {
  font-size: 2.8rem;
}

.auth-description {
  margin: 10px 0 27px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

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

.auth-form .button {
  width: 100%;
  margin-top: 2px;
}

.auth-switch {
  display: block;
  margin: 19px auto 0;
  padding: 3px;
  color: var(--green);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
}

.form-message {
  margin: 0;
  padding: 10px 12px;
  color: #8d3022;
  background: rgba(230, 109, 78, 0.11);
  border-radius: 9px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.form-message[data-tone="success"] {
  color: var(--green);
  background: rgba(31, 89, 71, 0.1);
}

.date-controls,
.button {
  display: flex;
  align-items: center;
}

.button {
  justify-content: center;
  min-height: 46px;
  padding: 0 19px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 720;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.button-primary {
  color: var(--white);
  background: var(--green);
  box-shadow: 0 8px 22px rgba(31, 89, 71, 0.17);
}

.button-primary:hover {
  background: #174b3b;
  box-shadow: 0 11px 27px rgba(31, 89, 71, 0.23);
}

.button-primary span {
  font-size: 1.25em;
  font-weight: 400;
  line-height: 1;
}

.button-quiet {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.button-quiet:hover {
  background: rgba(255, 255, 255, 0.45);
}

.button-danger {
  color: #8d3022;
  background: rgba(230, 109, 78, 0.09);
  border-color: rgba(169, 58, 42, 0.22);
}

.button-danger:hover {
  background: rgba(230, 109, 78, 0.16);
}

.app-shell > main {
  padding: 24px 0 60px;
}

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

.day-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: 220px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(29, 43, 38, 0.15);
}

.account-email {
  padding: 9px 10px 12px;
  overflow: hidden;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-panel button {
  padding: 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.account-menu-panel button:hover {
  background: var(--paper);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 0.97;
}

.date-controls {
  flex: 0 0 auto;
  gap: 5px;
  padding: 4px;
  background: rgba(255, 253, 248, 0.63);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.icon-button,
.date-button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  background: transparent;
  border-radius: 50%;
}

.icon-button:hover {
  background: var(--paper-deep);
}

.icon-button svg,
.date-button svg,
.entry-edit svg,
.entry-delete svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.date-button {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 112px;
  justify-content: center;
  padding: 0 12px;
  font-weight: 750;
  background: transparent;
}

.date-button svg {
  width: 17px;
}

.today-link {
  display: block;
  margin: 18px 0 -13px auto;
  padding: 5px 2px;
  color: var(--green);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.summary-card {
  position: relative;
  display: flex;
  min-height: 106px;
  padding: 16px 18px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.63);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.summary-card-featured {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
}

.summary-label {
  margin-bottom: auto;
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.summary-card-featured .summary-label {
  color: rgba(255, 255, 255, 0.66);
}

.summary-value {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.summary-orbit {
  position: absolute;
  top: -53px;
  right: -31px;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(215, 231, 181, 0.32);
  border-radius: 50%;
}

.summary-orbit::before,
.summary-orbit::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(215, 231, 181, 0.23);
  border-radius: inherit;
  inset: 22px;
}

.summary-orbit::after {
  inset: 45px;
  background: var(--green-bright);
  border: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  gap: 34px;
  align-items: start;
  margin-top: 42px;
}

.section-heading {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading.compact {
  padding-bottom: 18px;
}

.section-heading .eyebrow {
  margin-bottom: 9px;
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  letter-spacing: -0.035em;
  line-height: 1;
}

.entry-list {
  display: grid;
}

.entry-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 21px 4px;
  border-bottom: 1px solid var(--line);
  animation: entry-in 240ms ease both;
}

@keyframes entry-in {
  from { opacity: 0; transform: translateY(8px); }
}

.format-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--theme-foreground, var(--green));
  background: var(--theme-background, var(--green-bright));
  border-radius: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.entry-copy {
  min-width: 0;
}

.entry-title {
  margin: 0;
  overflow: hidden;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 760;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-title a {
  color: inherit;
  text-decoration-color: rgba(31, 89, 71, 0.35);
  text-underline-offset: 3px;
}

.entry-title a:hover {
  color: var(--green);
  text-decoration-color: currentColor;
}

.entry-meta,
.entry-notes {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.entry-notes {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-meta span + span::before {
  content: "·";
  margin: 0 7px;
  color: #a6aca8;
}

.entry-quality-picker {
  display: flex;
  margin-top: 11px;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.entry-quality-label {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 720;
}

.entry-quality-options {
  display: flex;
  gap: 5px;
}

.entry-quality-options button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--green);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 780;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.entry-quality-options button:hover,
.entry-quality-options button:focus-visible {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
  outline: none;
  transform: translateY(-1px);
}

.entry-quality-options button:focus-visible {
  box-shadow: 0 0 0 3px rgba(31, 89, 71, 0.14);
}

.entry-quality-options button:disabled {
  cursor: wait;
  opacity: 0.5;
  transform: none;
}

.entry-quality-options button.is-saving {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
  opacity: 1;
}

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

.duration-pill {
  min-width: 55px;
  padding: 7px 9px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.68);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  text-align: center;
}

.entry-edit,
.entry-delete {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.58;
  transition: opacity 150ms ease, color 150ms ease, background 150ms ease;
}

.entry-edit:hover {
  color: var(--green);
  background: rgba(31, 89, 71, 0.1);
  opacity: 1;
}

.entry-delete:hover {
  color: #a93a2a;
  background: rgba(230, 109, 78, 0.12);
  opacity: 1;
}

.entry-edit svg,
.entry-delete svg {
  width: 16px;
}

.empty-state {
  padding: 42px 20px 28px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  display: flex;
  width: 94px;
  height: 74px;
  margin: 0 auto 23px;
  align-items: flex-end;
  justify-content: center;
}

.empty-illustration::after {
  position: absolute;
  right: 7px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  background: var(--coral);
  border: 5px solid var(--paper);
  border-radius: 50%;
  content: "";
}

.empty-illustration span {
  position: absolute;
  width: 46px;
  height: 58px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 7px 20px rgba(29, 43, 38, 0.06);
}

.empty-illustration span:nth-child(1) { transform: rotate(-14deg) translate(-15px, 2px); }
.empty-illustration span:nth-child(2) { z-index: 1; height: 66px; }
.empty-illustration span:nth-child(3) { transform: rotate(14deg) translate(15px, 2px); }

.empty-illustration span::before,
.empty-illustration span::after {
  position: absolute;
  right: 9px;
  left: 9px;
  height: 1px;
  background: var(--line);
  content: "";
  top: 20px;
}

.empty-illustration span::after { top: 28px; }

.empty-state h3 {
  margin: 0;
  font-size: 1.45rem;
}

.empty-state p {
  max-width: 390px;
  margin: 10px auto 22px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.empty-state .button {
  margin-inline: auto;
}

.breakdown-card {
  padding: 27px;
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.breakdown-card h2 {
  font-size: 1.65rem;
}

.breakdown-list {
  display: grid;
  gap: 19px;
  margin-top: 25px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  font-size: 0.8rem;
  font-weight: 720;
}

.breakdown-row > span:last-of-type {
  color: var(--ink-soft);
}

.breakdown-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: 999px;
}

.breakdown-progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 7px;
  overflow: hidden;
  appearance: none;
  background: var(--paper-deep);
  border: 0;
  border-radius: 999px;
}

.breakdown-progress::-webkit-progress-bar {
  background: var(--paper-deep);
  border-radius: 999px;
}

.breakdown-progress::-webkit-progress-value {
  background: var(--theme-foreground, var(--green));
  border-radius: 999px;
}

.breakdown-progress::-moz-progress-bar {
  background: var(--theme-foreground, var(--green));
  border-radius: 999px;
}

.format-theme-0 { --theme-foreground: #1f5947; --theme-background: #d7e7b5; }
.format-theme-1 { --theme-foreground: #9a3f2a; --theme-background: #f2c5b8; }
.format-theme-2 { --theme-foreground: #4a4e8a; --theme-background: #d9d8ee; }
.format-theme-3 { --theme-foreground: #725324; --theme-background: #ead8ab; }
.format-theme-4 { --theme-foreground: #28637b; --theme-background: #c8e2ea; }
.format-theme-5 { --theme-foreground: #6d3f78; --theme-background: #e5cfe8; }

.breakdown-empty {
  margin: 23px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

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

.analytics-header > div:first-child > p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.range-tabs {
  display: flex;
  padding: 4px;
  gap: 3px;
  background: rgba(255, 253, 248, 0.63);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.range-tabs button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 760;
  cursor: pointer;
}

.range-tabs button[aria-pressed="true"] {
  color: var(--white);
  background: var(--green);
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.analytics-summary-card {
  display: flex;
  min-height: 96px;
  padding: 15px 17px;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255, 253, 248, 0.63);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.analytics-summary-card strong {
  margin-top: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.analytics-summary-featured {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
}

.analytics-summary-featured .summary-label {
  color: rgba(255, 255, 255, 0.66);
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.75fr);
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}

.analytics-card {
  min-width: 0;
  padding: 25px;
  background: rgba(255, 253, 248, 0.63);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.analytics-card-heading {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.analytics-card-heading .eyebrow {
  margin-bottom: 8px;
}

.analytics-card-heading h2 {
  font-size: 1.65rem;
}

.analytics-card-heading > span {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 740;
}

.activity-chart-wrap {
  width: 100%;
  padding-top: 25px;
  overflow: hidden;
}

.activity-chart {
  display: grid;
  grid-template-columns: repeat(var(--analytics-days, 30), minmax(2px, 1fr));
  height: 190px;
  gap: clamp(2px, 0.45vw, 6px);
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.activity-column {
  display: flex;
  height: 100%;
  align-items: end;
}

.activity-bar {
  width: 100%;
  min-height: 3px;
  height: var(--activity-level, 0%);
  background: var(--green);
  border-radius: 4px 4px 0 0;
  opacity: 0.78;
}

.activity-column:hover .activity-bar {
  background: var(--coral);
  opacity: 1;
}

.activity-axis {
  display: flex;
  margin-top: 8px;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 650;
}

.analytics-format-list {
  margin-top: 22px;
}

.analytics-empty {
  margin-top: 24px;
  padding: 48px 24px;
  background: rgba(255, 253, 248, 0.48);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}

.analytics-empty h2 {
  font-size: 1.5rem;
}

.analytics-empty p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.analytics-view.is-loading {
  opacity: 0.58;
}

.mobile-add {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: none;
  width: 58px;
  height: 58px;
  color: var(--white);
  background: var(--green);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(31, 89, 71, 0.28);
  font-size: 1.7rem;
  cursor: pointer;
}

.entry-dialog {
  width: min(650px, calc(100% - 32px));
  max-height: min(860px, calc(100vh - 40px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.entry-dialog::backdrop {
  background: rgba(18, 31, 26, 0.56);
  backdrop-filter: blur(5px);
}

.entry-dialog[open] {
  animation: dialog-in 200ms ease both;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
}

.entry-dialog form {
  display: flex;
  max-height: min(860px, calc(100vh - 40px));
  flex-direction: column;
}

.settings-body {
  display: grid;
  gap: 16px;
  padding: 25px 29px 29px;
  overflow-y: auto;
}

.settings-body > p:first-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.settings-format-list {
  display: grid;
  gap: 9px;
}

.settings-format-row {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
}

.settings-format-row input {
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.remove-format-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  align-self: center;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}

.remove-format-button:hover {
  color: #a93a2a;
  background: rgba(230, 109, 78, 0.12);
}

.add-format-button {
  justify-self: start;
}

.shortcut-settings {
  display: grid;
  gap: 15px;
  margin-top: 7px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.shortcut-settings h3 {
  margin: 0;
  font-size: 1.35rem;
}

.shortcut-settings > div:first-child > p,
.shortcut-credentials > p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.79rem;
  line-height: 1.5;
}

.shortcut-status {
  width: fit-content;
  margin: 0;
  padding: 6px 10px;
  color: var(--ink-soft);
  background: rgba(29, 43, 38, 0.06);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 720;
}

.shortcut-status[data-enabled="true"] {
  color: var(--green);
  background: rgba(31, 89, 71, 0.1);
}

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

.shortcut-actions .button {
  min-height: 40px;
  padding-inline: 14px;
  font-size: 0.76rem;
}

.shortcut-credentials {
  display: grid;
  gap: 11px;
  padding: 15px;
  background: rgba(215, 231, 181, 0.18);
  border: 1px solid rgba(31, 89, 71, 0.16);
  border-radius: 13px;
}

.shortcut-credentials > p {
  margin-top: 0;
  color: var(--green);
  font-weight: 650;
}

.shortcut-credentials label {
  display: grid;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 740;
}

.shortcut-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.shortcut-copy-row input {
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
}

.shortcut-copy-row button {
  padding: 0 12px;
  color: var(--green);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 780;
  cursor: pointer;
}

.shortcut-help {
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.shortcut-help summary {
  color: var(--green);
  font-weight: 760;
  cursor: pointer;
}

.shortcut-help ol {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding-left: 20px;
  line-height: 1.45;
}

.entry-list.is-loading {
  min-height: 120px;
  opacity: 0.55;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 25px 29px;
}

.dialog-heading {
  border-bottom: 1px solid var(--line);
}

.dialog-heading .eyebrow {
  margin-bottom: 8px;
}

.dialog-heading h2 {
  font-size: 2rem;
}

.close-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
}

.form-body {
  display: grid;
  grid-template-columns: 1fr 0.55fr;
  gap: 20px;
  padding: 27px 29px 29px;
  overflow-y: auto;
}

.field,
.format-field {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field > span,
.format-field legend {
  font-size: 0.77rem;
  font-style: normal;
  font-weight: 760;
}

.field em,
.format-field em {
  margin-left: 4px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 550;
}

.field input,
.field textarea {
  width: 100%;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border 150ms ease, box-shadow 150ms ease;
}

.field input {
  min-height: 49px;
  padding: 0 14px;
}

.field textarea {
  padding: 13px 14px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 89, 71, 0.1);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9b9f9b;
}

.format-field legend {
  margin-bottom: 9px;
}

.format-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 8px;
}

.format-options label {
  position: relative;
}

.format-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.format-options span {
  display: grid;
  min-height: 44px;
  place-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 720;
  cursor: pointer;
}

.format-options input:checked + span {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
}

.format-options input:focus-visible + span {
  outline: 3px solid rgba(230, 109, 78, 0.35);
  outline-offset: 3px;
}

.quality-options {
  grid-template-columns: repeat(5, 1fr);
}

.quality-scale {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 650;
}

.dialog-actions {
  justify-content: flex-end;
  padding-top: 18px;
  padding-bottom: 18px;
  background: var(--white);
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 50;
  bottom: 25px;
  left: 50%;
  display: flex;
  min-width: 240px;
  padding: 13px 15px 13px 18px;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 700;
  transform: translateX(-50%);
  animation: toast-in 180ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
}

.toast button {
  padding: 5px 8px;
  color: var(--green-bright);
  background: transparent;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  padding: 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: 12px;
  text-align: center;
}

@media (max-width: 820px) {
  .app-shell { width: min(100% - 32px, 680px); }
  .desktop-add { display: none; }
  .mobile-add { display: grid; place-items: center; }
  .app-shell > main { padding-top: 26px; }
  .day-header { align-items: flex-start; flex-direction: column; }
  .day-actions { align-self: flex-start; }
  .today-link { margin-left: 0; margin-right: auto; }
  .content-grid { grid-template-columns: 1fr; gap: 38px; margin-top: 38px; }
  .breakdown-card { order: -1; }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .auth-view { padding: 12px; }
  .auth-card { padding: 27px 22px; }
  .auth-mark { margin-bottom: 25px; }
  .app-shell { width: calc(100% - 24px); }
  .app-menu-bar { top: 8px; width: 100%; margin-top: 8px; justify-content: space-between; }
  .view-tab { min-height: 38px; padding: 0 11px; }
  .view-tab svg { width: 16px; }
  h1 { font-size: 2.65rem; }
  .summary-grid { grid-template-columns: 1.2fr 0.9fr 0.9fr; gap: 7px; margin-top: 22px; }
  .summary-card { min-height: 82px; padding: 11px; border-radius: 14px; }
  .summary-label { font-size: 0.59rem; letter-spacing: 0.06em; }
  .summary-value { font-size: 1.45rem; white-space: nowrap; }
  .section-heading { align-items: center; }
  .entry-card { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
  .format-icon { width: 42px; height: 42px; }
  .entry-quality-picker { align-items: flex-start; flex-direction: column; gap: 6px; }
  .entry-actions { grid-column: 2; justify-content: space-between; }
  .duration-pill { order: 1; }
  .entry-edit { order: 2; }
  .entry-delete { order: 3; }
  .breakdown-card { padding: 22px; }
  .entry-dialog { width: calc(100% - 16px); max-height: calc(100vh - 16px); border-radius: 22px; }
  .entry-dialog form { max-height: calc(100vh - 16px); }
  .dialog-heading { padding: 20px; }
  .form-body { grid-template-columns: 1fr; gap: 18px; padding: 22px 20px 25px; }
  .field-wide { grid-column: auto; }
  .format-options { grid-template-columns: 1fr 1fr; }
  .quality-options { grid-template-columns: repeat(5, 1fr); }
  .dialog-actions { padding: 14px 20px; }
  .dialog-actions .button { flex: 1; }
  .settings-body { padding: 22px 20px 25px; }
  .account-menu summary { width: 42px; height: 42px; }
  .account-menu-panel { right: -2px; }
  .analytics-header { align-items: flex-start; flex-direction: column; }
  .range-tabs { width: 100%; }
  .range-tabs button { flex: 1; }
  .analytics-summary-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 22px; }
  .analytics-summary-card { min-height: 82px; padding: 12px; border-radius: 14px; }
  .analytics-summary-card strong { font-size: 1.55rem; }
  .analytics-card { padding: 21px 18px; border-radius: 20px; }
  .activity-chart { grid-template-columns: repeat(var(--analytics-days, 30), minmax(1px, 1fr)); height: 150px; gap: 1px; }
  .toast { bottom: 90px; }
}

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