:root {
  --ink: #12212c;
  --ink-soft: #42515b;
  --paper: #f8f8f4;
  --canvas: #eef1ed;
  --line: #d8ded9;
  --white: #ffffff;
  --teal: #157c73;
  --teal-dark: #0c5d57;
  --coral: #e85045;
  --coral-dark: #c83c34;
  --amber: #d99024;
  --green: #2c8665;
  --shadow: 0 18px 48px rgba(18, 33, 44, 0.09);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% -5%, rgba(21, 124, 115, 0.1), transparent 35%),
    var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(21, 124, 115, 0.35);
  outline-offset: 3px;
}

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

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #7fd2c8;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #e4e9e6;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

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

.button-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 10px 20px rgba(21, 124, 115, 0.2);
}

.button-primary:hover {
  background: var(--teal-dark);
}

.button-block {
  width: 100%;
}

.button-small {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  background: var(--ink);
  color: var(--white);
  font-size: 0.88rem;
}

.notice {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid;
  border-radius: 13px;
  font-size: 0.9rem;
}

.notice ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.notice-error {
  border-color: #f0b8b4;
  background: #fff1ef;
  color: #8e2c25;
}

.notice-success {
  border-color: #a8d8c3;
  background: #effaf4;
  color: #175e43;
}

.notice-info {
  border-color: #bad7df;
  background: #f0f8fa;
  color: #285967;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom));
  background:
    linear-gradient(140deg, rgba(18, 33, 44, 0.97), rgba(18, 33, 44, 0.87)),
    radial-gradient(circle at top right, var(--teal), transparent 45%);
}

.auth-shell {
  width: min(100%, 430px);
}

.install-shell {
  width: min(100%, 620px);
  margin-block: 2rem;
}

.auth-card {
  padding: clamp(1.5rem, 6vw, 2.4rem);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.auth-intro {
  margin: 0.75rem 0 1.5rem;
  color: var(--ink-soft);
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  border-radius: 17px;
  background: var(--ink);
  box-shadow: 0 10px 22px rgba(18, 33, 44, 0.2);
}

.brand-mark span,
.mini-mark,
.mic-shape {
  position: relative;
  display: block;
  width: 14px;
  height: 24px;
  border-radius: 10px;
  background: var(--coral);
}

.brand-mark span::after,
.mini-mark::after,
.mic-shape::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 22px;
  height: 15px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  color: #7fd2c8;
  transform: translateX(-50%);
}

.brand-mark span::before,
.mini-mark::before,
.mic-shape::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: #7fd2c8;
  transform: translateX(-50%);
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.stack-form fieldset {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.stack-form legend {
  padding: 0 0.4rem;
  color: var(--ink);
  font-weight: 800;
}

.field {
  display: grid;
  gap: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.83rem;
  font-weight: 700;
}

.field input,
.task-title-input,
.status-select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cbd3ce;
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 550;
  transition: border 150ms ease, box-shadow 150ms ease;
}

.field input:focus,
.task-title-input:focus,
.status-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(21, 124, 115, 0.1);
  outline: 0;
}

.field small {
  font-weight: 500;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 0.75rem;
}

.offline-card {
  text-align: center;
}

.offline-card .brand-mark {
  margin-inline: auto;
}

.app-page {
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.7rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.7rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(18, 33, 44, 0.08);
  background: rgba(238, 241, 237, 0.88);
  backdrop-filter: blur(18px);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.mini-mark {
  width: 10px;
  height: 17px;
}

.mini-mark::after {
  width: 17px;
  height: 11px;
  border-width: 2px;
  bottom: -5px;
  color: var(--teal);
}

.mini-mark::before {
  bottom: -8px;
  width: 2px;
  height: 5px;
  background: var(--teal);
}

.quiet-button {
  min-height: 40px;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.quiet-button:hover {
  background: rgba(18, 33, 44, 0.06);
}

.app-shell {
  width: min(100% - 1.25rem, 940px);
  margin: 0 auto;
  padding-top: 0.75rem;
}

.flash-notice {
  margin: 0 0 0.75rem;
}

.record-card {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 1.3rem;
  overflow: hidden;
  padding: clamp(1.25rem, 6vw, 2.1rem);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 5%, rgba(127, 210, 200, 0.18), transparent 32%),
    linear-gradient(145deg, #12212c 0%, #172d38 100%);
  color: var(--white);
  box-shadow: var(--shadow);
}

.record-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -40px -75px auto;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(127, 210, 200, 0.17);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(127, 210, 200, 0.035), 0 0 0 58px rgba(127, 210, 200, 0.025);
}

.record-card h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(1.75rem, 8vw, 3.25rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.record-status {
  min-height: 1.5em;
  margin: 0.85rem 0 0;
  color: #c5d3d8;
  font-size: 0.93rem;
}

.record-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.record-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1.15rem 0.45rem 0.45rem;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.26);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

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

.record-button:active {
  transform: scale(0.98);
}

.record-button-core {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
}

.mic-shape {
  width: 10px;
  height: 18px;
  background: var(--white);
}

.mic-shape::after {
  width: 17px;
  height: 11px;
  border-width: 2px;
  bottom: -5px;
  color: var(--white);
}

.mic-shape::before {
  bottom: -8px;
  width: 2px;
  height: 5px;
  background: var(--white);
}

.record-button.is-recording {
  background: #fff0ee;
  color: #9f2d26;
  box-shadow: 0 0 0 6px rgba(232, 80, 69, 0.18), 0 12px 35px rgba(0, 0, 0, 0.26);
}

.record-button.is-recording .record-button-core {
  animation: record-pulse 1.25s infinite;
}

.record-button.is-recording .mic-shape {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.record-button.is-recording .mic-shape::before,
.record-button.is-recording .mic-shape::after {
  display: none;
}

.record-button.is-uploading .record-button-core::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.42);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.record-button.is-uploading .mic-shape {
  display: none;
}

.record-timer {
  min-width: 76px;
  color: #dce6e9;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
}

.upload-meter {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.upload-meter span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: 10px;
  background: #7fd2c8;
  animation: upload-slide 1.2s ease-in-out infinite;
}

.install-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  margin: 0.75rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid #c9ddd7;
  border-radius: 15px;
  background: #f6fbf9;
  color: var(--ink);
  text-align: left;
}

.install-card strong,
.install-card small {
  display: block;
}

.install-card small {
  margin-top: 0.05rem;
  color: var(--ink-soft);
}

.install-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--teal);
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 900;
}

.task-section {
  padding-top: 2rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-inline: 0.25rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 6vw, 2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.task-total {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.filter-tabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding: 0.25rem 0 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tabs a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.filter-tabs a span {
  min-width: 20px;
  padding: 0.05rem 0.35rem;
  border-radius: 99px;
  background: rgba(18, 33, 44, 0.06);
  font-size: 0.72rem;
  text-align: center;
}

.filter-tabs a.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.filter-tabs a.active span {
  background: rgba(255, 255, 255, 0.13);
}

.task-list {
  display: grid;
  gap: 0.75rem;
}

.task-card {
  position: relative;
  padding: 1rem;
  border: 1px solid rgba(18, 33, 44, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 25px rgba(18, 33, 44, 0.045);
}

.task-card-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(232, 80, 69, 0.1);
}

.status-in_progress .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(217, 144, 36, 0.11);
}

.status-completed .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(44, 134, 101, 0.11);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  color: #6b777e;
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.task-card audio {
  width: 100%;
  height: 44px;
  margin-bottom: 0.8rem;
  border-radius: 11px;
  accent-color: var(--teal);
}

.task-edit-form {
  display: grid;
  gap: 0.7rem;
}

.task-title-input {
  min-height: 46px;
  border-color: transparent;
  background: #f1f3f0;
  font-weight: 750;
}

.task-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
}

.status-select {
  min-height: 42px;
  padding-block: 0.5rem;
  background-color: var(--white);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.delete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}

.delete-button {
  min-height: 38px;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  color: #93625e;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.delete-button:hover {
  color: var(--coral-dark);
  text-decoration-color: currentColor;
}

.empty-state {
  padding: clamp(2rem, 10vw, 4rem) 1.5rem;
  border: 1px dashed #c8d0cb;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.empty-state h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1.15rem;
}

.empty-state p {
  max-width: 420px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.empty-wave {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.empty-wave i {
  width: 5px;
  height: 18px;
  border-radius: 5px;
  background: var(--teal);
}

.empty-wave i:nth-child(2),
.empty-wave i:nth-child(4) {
  height: 32px;
}

.empty-wave i:nth-child(3) {
  height: 24px;
  background: var(--coral);
}

.toast {
  position: fixed;
  z-index: 50;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  left: 1rem;
  max-width: 440px;
  margin-inline: auto;
  padding: 0.85rem 1rem;
  border-radius: 13px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 15px 45px rgba(18, 33, 44, 0.28);
  font-size: 0.9rem;
  font-weight: 650;
  text-align: center;
}

.toast[data-type="error"] {
  background: #8e2c25;
}

.toast[data-type="success"] {
  background: #176347;
}

.noscript-note {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99;
  padding: 0.75rem;
  background: #8e2c25;
  color: var(--white);
  text-align: center;
}

@keyframes record-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 80, 69, 0.5); }
  50% { box-shadow: 0 0 0 9px rgba(232, 80, 69, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes upload-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(390%); }
}

@keyframes attention {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.08); }
}

.attention-pulse {
  animation: attention 650ms ease-in-out 2;
}

@media (min-width: 680px) {
  .app-header {
    padding-inline: max(1.5rem, calc((100vw - 940px) / 2));
  }

  .app-shell {
    width: min(100% - 3rem, 940px);
    padding-top: 1.5rem;
  }

  .record-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 310px;
  }

  .record-control {
    flex-direction: column;
    justify-content: center;
    min-width: 200px;
  }

  .record-button {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem;
    width: 126px;
    height: 126px;
    border-radius: 50%;
  }

  .record-button-core {
    width: 58px;
    height: 58px;
  }

  .record-timer {
    min-width: 0;
    text-align: center;
  }

  .task-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 390px) {
  .app-shell {
    width: min(100% - 0.8rem, 940px);
  }

  .record-card {
    padding: 1.1rem;
    border-radius: 22px;
  }

  .record-button {
    padding-right: 0.85rem;
  }

  .record-button-core {
    width: 48px;
    height: 48px;
  }

  .record-timer {
    min-width: 64px;
    font-size: 1.15rem;
  }

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

@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;
  }
}
