﻿:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-strong: #eef5ef;
  --ink: #1d2b24;
  --muted: #66746c;
  --line: #d9ded7;
  --green: #315f4b;
  --leaf: #5c8d62;
  --amber: #bc7a25;
  --red: #b44737;
  --blue: #3f6d91;
  --shadow: 0 12px 32px rgba(32, 42, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}


.app-page.auth-pending main,
.app-page.auth-guest main,
.app-page.auth-unconfigured main,
.app-page.auth-pending .mobile-nav,
.app-page.auth-guest .mobile-nav,
.app-page.auth-unconfigured .mobile-nav {
  display: none;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-hero {
  display: grid;
  gap: 18px;
  width: min(720px, 100%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-icon {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.login-brand h1 {
  font-size: 36px;
}.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 18px 92px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 18px;
}

.brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(32, 42, 36, 0.12);
}

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

.auth-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px;
}

.auth-account {
  display: grid;
  gap: 2px;
  min-width: 132px;
}

.auth-account span,
.auth-account small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-account strong {
  max-width: 190px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.social-button,
.signout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.social-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.social-button span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.social-button.google span {
  background: #ffffff;
  color: #4285f4;
}

.social-button.kakao {
  border-color: #efd84f;
  background: #fee500;
  color: #191600;
}

.social-button.kakao span {
  background: #191600;
  color: #fee500;
}

.social-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.signout-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.today-basis {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(32, 42, 36, 0.08);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.summary-card.overdue strong {
  color: var(--red);
}

.summary-card.today strong {
  color: var(--amber);
}

.summary-card.upcoming strong {
  color: var(--blue);
}

.login-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

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

.login-copy span {
  display: block;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 800;
}

.login-copy h2 {
  margin: 4px 0 5px;
  overflow-wrap: anywhere;
  font-size: 19px;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 8px;
}

.provider-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.provider-card > span {
  grid-row: 1 / 3;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
}

.provider-card strong,
.provider-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-card strong {
  font-size: 13px;
}

.provider-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.provider-card.google > span {
  background: #ffffff;
  color: #4285f4;
  box-shadow: inset 0 0 0 1px var(--line);
}

.provider-card.kakao {
  border-color: #efd84f;
  background: #fee500;
  color: #191600;
}

.provider-card.kakao > span {
  background: #191600;
  color: #fee500;
}

.provider-card.signout > span {
  background: var(--surface-strong);
  color: var(--green);
}

.provider-card:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.search-field {
  display: grid;
  gap: 7px;
}

.search-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

.search-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(49, 95, 75, 0.15);
}

.segmented {
  display: inline-flex;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 3px;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.segmented button.active {
  background: var(--green);
  color: #fff;
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 10px;
}

.list-head h2 {
  margin: 0;
  font-size: 19px;
}

.list-head span {
  color: var(--muted);
  font-size: 14px;
}

.plant-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.plant-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 13px;
  min-height: 144px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.plant-image {
  width: 86px;
  height: 124px;
  border-radius: 6px;
  background: var(--surface-strong);
  object-fit: cover;
}

.plant-body {
  min-width: 0;
}

.plant-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.plant-title h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.3;
}

.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.overdue {
  background: #fae7e2;
  color: var(--red);
}

.status.today {
  background: #fff0d7;
  color: var(--amber);
}

.status.upcoming {
  background: #e8f0f8;
  color: var(--blue);
}

.status.later {
  background: #edf2ed;
  color: var(--green);
}

.meta {
  display: grid;
  gap: 4px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.period-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.period-control label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.period-control input {
  width: 64px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
}

.water-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
}

.water-button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  padding: 34px;
  text-align: center;
}

.plant-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--leaf);
  font-size: 15px;
  font-weight: 800;
}

.delete-button {
  height: 36px;
  border: 1px solid #f0c6bf;
  border-radius: 6px;
  background: #fff7f5;
  color: var(--red);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
}

.plant-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.form-section h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-grid label {
  display: grid;
  gap: 7px;
}

.form-grid label.full {
  grid-column: 1 / -1;
}

.photo-preview {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
}

.photo-preview img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

.form-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-grid input,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

.form-grid input {
  height: 44px;
}

.form-grid textarea {
  resize: vertical;
  min-height: 104px;
}

.form-grid input:focus,
.form-grid textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(49, 95, 75, 0.15);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.primary-button,
.secondary-button {
  height: 42px;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--green);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mobile-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  width: min(420px, calc(100% - 24px));
  transform: translateX(-50%);
  border: 1px solid rgba(217, 222, 215, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(32, 42, 36, 0.18);
  backdrop-filter: blur(12px);
  padding: 4px;
}

.mobile-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 54px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.mobile-nav span {
  font-size: 20px;
  line-height: 1;
}

.mobile-nav strong {
  font-size: 12px;
  line-height: 1.2;
}

.mobile-nav button.active {
  background: var(--green);
  color: #fff;
}

.camera-dialog {
  width: min(560px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.camera-dialog::backdrop {
  background: rgba(15, 22, 18, 0.52);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 19px;
}

#cameraPreview {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: #111;
  object-fit: cover;
}

#cameraStatus {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px 12px 96px;
  }

  h1 {
    font-size: 25px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-card {
    min-height: 76px;
    padding: 11px;
  }

  .summary-card strong {
    font-size: 25px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

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

  .login-provider-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    display: grid;
    width: 100%;
  }

  .filter-tabs {
    grid-template-columns: repeat(4, 1fr);
  }

  .sort-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .segmented button {
    padding: 0 6px;
    font-size: 13px;
  }

  .plant-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
    margin: 0 -12px;
    padding: 12px;
    background: rgba(244, 241, 234, 0.94);
    backdrop-filter: blur(12px);
  }

  .topbar-actions {
    width: 100%;
    align-items: stretch;
  }

  .auth-panel {
    flex: 1;
    justify-content: space-between;
    min-width: 0;
  }

  .auth-account {
    min-width: 0;
  }

  .auth-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .form-section {
    padding: 14px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .plant-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .plant-image {
    width: 74px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .water-button {
    width: 100%;
  }
}

