:root {
  color-scheme: light;
  --navy: #081735;
  --muted: #667085;
  --line: #dfe7ef;
  --paper: #ffffff;
  --bg: #f2f6fa;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --teal-soft: #e7f5f2;
  --gold: #d09518;
  --gold-soft: #fff5d8;
  --blue: #315ee7;
  --blue-soft: #e9efff;
  --red: #c24132;
  --shadow: 0 16px 38px rgba(8, 23, 53, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
  color: var(--navy);
}

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

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.38rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 1.02rem;
  line-height: 1.15;
}

.is-hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.34;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--teal-dark);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: max(0.72rem, env(safe-area-inset-top)) 0.9rem 0.72rem;
  border-bottom: 1px solid rgba(223, 231, 239, 0.82);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.62rem;
}

.brand-lockup img {
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
  line-height: 1.08;
}

.brand-lockup strong {
  font-size: 1.02rem;
}

.brand-lockup span {
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 760;
}

.icon-button {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.icon-button svg {
  width: 1.18rem;
  height: 1.18rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0.82rem 0.72rem max(2rem, env(safe-area-inset-bottom));
}

.screen {
  display: grid;
  gap: 0.78rem;
}

.hero-card,
.entry-card,
.recent-card,
.task-button,
.entry-head {
  border: 1px solid rgba(223, 231, 239, 0.95);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.92rem;
}

.ghost-button {
  min-height: 2.22rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.86rem;
  font-weight: 780;
}

.task-message {
  min-height: 0;
  margin: -0.18rem 0 0;
  padding: 0.7rem 0.82rem;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 0.95rem;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.86rem;
  font-weight: 760;
}

.task-message:empty {
  display: none;
}

.task-message.is-error {
  border-color: #efc7bf;
  background: #fff0ed;
  color: var(--red);
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.task-button {
  display: grid;
  min-height: 7.1rem;
  align-content: space-between;
  justify-items: start;
  padding: 0.85rem;
  text-align: left;
  color: var(--navy);
}

.task-button:nth-child(4n + 1) {
  border-top: 0.25rem solid var(--teal);
}

.task-button:nth-child(4n + 2) {
  border-top: 0.25rem solid var(--blue);
}

.task-button:nth-child(4n + 3) {
  border-top: 0.25rem solid var(--gold);
}

.task-button:nth-child(4n + 4) {
  border-top: 0.25rem solid #8b5cf6;
}

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

.task-code {
  display: inline-grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: 0.8rem;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.task-button:nth-child(4n + 2) .task-code {
  background: var(--blue-soft);
  color: var(--blue);
}

.task-button:nth-child(4n + 3) .task-code {
  background: var(--gold-soft);
  color: #9a6410;
}

.task-button:nth-child(4n + 4) .task-code {
  background: #f1eaff;
  color: #6d42d8;
}

.task-title {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.12;
}

.task-detail {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.entry-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.72rem;
  padding: 0.86rem;
}

.entry-title-block {
  min-width: 0;
}

.entry-user-line {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.2;
}

.back-button {
  min-height: 2.42rem;
  padding: 0 0.78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 780;
}

.time-button {
  display: grid;
  min-width: 5.35rem;
  min-height: 2.56rem;
  align-content: center;
  gap: 0.08rem;
  padding: 0.34rem 0.68rem;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 0.9rem;
  background: var(--teal-soft);
  color: var(--teal-dark);
  text-align: left;
}

.time-button span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.time-button strong {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 840;
  line-height: 1.1;
  white-space: nowrap;
}

.entry-card,
.recent-card {
  padding: 0.94rem;
}

.entry-card {
  display: grid;
  gap: 0.78rem;
}

.time-field {
  padding: 0.72rem;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 0.95rem;
  background: rgba(231, 245, 242, 0.45);
}

.field-label {
  margin: 0;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
}

.room-field {
  display: grid;
  gap: 0.52rem;
}

.room-select {
  display: none;
}

.room-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.48rem;
}

.room-chip {
  min-height: 2.72rem;
  padding: 0 0.5rem;
  border: 1px solid rgba(49, 94, 231, 0.18);
  border-radius: 0.86rem;
  background: #fff;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
}

.room-chip.is-active {
  border-color: rgba(49, 94, 231, 0.6);
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(49, 94, 231, 0.2);
}

.note-panel {
  display: grid;
  gap: 0.52rem;
}

.note-button {
  display: grid;
  min-height: 3rem;
  gap: 0.1rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #fff;
  color: var(--navy);
  text-align: left;
}

.note-button span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 820;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.note-button strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-field {
  padding: 0.72rem;
  border: 1px solid rgba(223, 231, 239, 0.9);
  border-radius: 0.95rem;
  background: #fbfcfe;
}

label {
  display: grid;
  min-width: 0;
  gap: 0.34rem;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.86rem;
  background: #fff;
  color: var(--navy);
  outline: none;
  box-shadow: none;
}

input,
select {
  min-height: 2.75rem;
  padding: 0 0.78rem;
}

textarea {
  min-height: 6.15rem;
  padding: 0.78rem;
  line-height: 1.4;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.form-row {
  display: grid;
  gap: 0.68rem;
}

.form-row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.follow-row {
  grid-template-columns: minmax(0, 1fr) 7.2rem;
  align-items: end;
}

.toggle-line {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.52rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #fff;
}

.toggle-line input {
  width: 1.1rem;
  min-height: 1.1rem;
  accent-color: var(--teal);
}

.primary-button {
  position: sticky;
  bottom: max(0.72rem, env(safe-area-inset-bottom));
  z-index: 3;
  min-height: 3rem;
  border: 1px solid var(--teal-dark);
  border-radius: 0.95rem;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  font-size: 0.98rem;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.form-message {
  min-height: 1.16rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.form-message.is-error {
  color: var(--red);
  font-weight: 800;
}

.recent-card {
  margin-top: 0.78rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.recent-list {
  display: grid;
  gap: 0.54rem;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.62rem;
  padding: 0.72rem 0;
  border-top: 1px solid rgba(223, 231, 239, 0.82);
}

.recent-item:first-child {
  border-top: 0;
}

.recent-main {
  display: grid;
  gap: 0.22rem;
}

.recent-main strong {
  font-size: 0.92rem;
}

.recent-meta,
.recent-tags {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.recent-status {
  align-self: start;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.7rem;
  font-weight: 820;
  white-space: nowrap;
}

.recent-status.is-open {
  background: #fff7ed;
  color: #a16207;
}

.login-body {
  background:
    radial-gradient(circle at 10% 0%, rgba(208, 149, 24, 0.18), transparent 20rem),
    linear-gradient(180deg, #fbfcfe 0%, #eef3f8 100%);
}

.login-screen {
  display: grid;
  width: min(100%, 680px);
  min-height: 100vh;
  align-content: center;
  gap: 1rem;
  margin: 0 auto;
  padding: 1rem;
}

.login-brand,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 1.28rem;
  text-align: center;
}

.login-brand img {
  width: min(25rem, 82vw);
  height: auto;
}

.login-panel {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
}

.login-form {
  display: grid;
  gap: 0.82rem;
}

.login-form button {
  min-height: 3rem;
  border: 0;
  border-radius: 0.95rem;
  background: var(--navy);
  color: #fff;
  font-weight: 850;
}

.login-error {
  padding: 0.76rem 0.88rem;
  border: 1px solid #efc7bf;
  border-radius: 0.9rem;
  background: #fff0ed;
  color: #8f3526;
  font-size: 0.88rem;
  font-weight: 760;
}

@media (max-width: 430px) {
  .app-shell {
    padding-right: 0.62rem;
    padding-left: 0.62rem;
  }

  .hero-card {
    padding: 0.82rem;
  }

  .task-grid {
    gap: 0.62rem;
  }

  .task-button {
    min-height: 6.45rem;
    padding: 0.76rem;
  }

  .task-title {
    font-size: 0.94rem;
  }

  .entry-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .time-button {
    grid-column: 2;
    width: max-content;
    min-width: 5rem;
  }

  .form-row.two,
  .follow-row {
    grid-template-columns: 1fr;
  }
}
