@import url("/fonts/noto/400.css");
@import url("/fonts/noto/700.css");
@import url("/fonts/mono/400.css");
@import url("/fonts/mono/700.css");

:root {
  --ink: #15231d;
  --ink-2: #22352c;
  --paper: #f3f0e8;
  --paper-2: #ebe6da;
  --white: #fffdf7;
  --moss: #2e7d5a;
  --moss-bright: #42c58a;
  --signal: #f06b3f;
  --line: rgba(21, 35, 29, .14);
  --muted: #6c746f;
  --danger: #b7362d;
  --shadow: 0 24px 70px rgba(12, 25, 19, .18);
  --font-body: "Noto Sans SC", sans-serif;
  --font-display: "Noto Sans SC", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; min-height: 100%; margin: 0; }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(66, 197, 138, .4);
  outline-offset: 2px;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 70% 22%, rgba(66, 197, 138, .2), transparent 32%),
    repeating-linear-gradient(115deg, transparent 0 31px, rgba(21, 35, 29, .04) 32px 33px),
    var(--paper);
}
.boot-mark {
  width: 74px; height: 74px; margin: auto;
  display: grid; place-items: center;
  border-radius: 26px 8px 26px 8px;
  color: var(--paper); background: var(--ink);
  font-family: var(--font-mono); font-weight: 800; letter-spacing: -.08em;
  box-shadow: 12px 12px 0 var(--moss-bright);
}
.boot-screen p { margin-top: 30px; color: var(--muted); }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
  background: var(--paper);
}
.auth-panel { padding: clamp(28px, 6vw, 84px); display: flex; flex-direction: column; justify-content: center; }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 17px 5px 17px 5px; color: var(--paper); background: var(--ink);
  font-family: var(--font-mono); font-size: 13px; font-weight: 800; letter-spacing: -.08em;
}
.brand-name { font: 700 21px/1 var(--font-display); letter-spacing: -.02em; }
.brand-sub { display: block; margin-top: 5px; color: var(--muted); font: 10px/1 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; }
.auth-copy { margin: clamp(52px, 10vh, 92px) 0 34px; }
.eyebrow { color: var(--moss); font: 700 11px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.auth-copy h1 { margin: 16px 0 14px; max-width: 380px; font: 700 clamp(38px, 5vw, 60px)/.98 var(--font-display); letter-spacing: -.055em; }
.auth-copy p { max-width: 390px; color: var(--muted); line-height: 1.8; }
.auth-tabs { display: flex; gap: 4px; width: max-content; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.52); }
.auth-tab { min-width: 92px; min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; }
.auth-tab.active { color: var(--white); background: var(--ink); }
.auth-form { display: grid; gap: 16px; max-width: 420px; margin-top: 24px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.input {
  width: 100%; min-height: 50px; padding: 0 15px;
  border: 1px solid var(--line); border-radius: 13px;
  color: var(--ink); background: rgba(255,253,247,.85);
  transition: border .2s, box-shadow .2s;
}
.input:focus { border-color: var(--moss); box-shadow: 0 0 0 4px rgba(46,125,90,.1); outline: 0; }
.helper { color: var(--muted); font-size: 12px; line-height: 1.6; }
.btn {
  min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink); background: var(--paper-2); font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: var(--white); background: var(--ink); box-shadow: 0 9px 22px rgba(21,35,29,.18); }
.btn-primary:hover { background: var(--moss); }
.btn-signal { color: #28140d; background: var(--signal); }
.btn-ghost { border-color: var(--line); background: rgba(255,255,255,.45); }
.btn-danger { color: var(--danger); border-color: rgba(183,54,45,.22); background: rgba(183,54,45,.06); }
.btn-small { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.btn-wide { width: 100%; }
.auth-visual {
  position: relative; overflow: hidden; min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(21,35,29,.28), transparent 48%),
    radial-gradient(circle at 72% 34%, rgba(66,197,138,.9), transparent 0 2%, transparent 2.5%),
    radial-gradient(circle at 72% 34%, rgba(66,197,138,.18), transparent 0 12%, transparent 12.5%),
    repeating-radial-gradient(ellipse at 72% 34%, transparent 0 48px, rgba(243,240,232,.13) 49px 50px),
    var(--ink);
}
.auth-visual::before, .auth-visual::after { content: ""; position: absolute; border: 1px solid rgba(243,240,232,.25); border-radius: 50%; }
.auth-visual::before { width: 62vw; height: 62vw; left: 18%; top: 8%; }
.auth-visual::after { width: 26vw; height: 26vw; right: 8%; bottom: 6%; }
.visual-note { position: absolute; left: 9%; bottom: 10%; max-width: 360px; color: var(--paper); }
.visual-note strong { display: block; font: 700 clamp(36px,5vw,70px)/1 var(--font-display); letter-spacing: -.05em; }
.visual-note span { display: block; margin-top: 20px; color: rgba(243,240,232,.66); line-height: 1.8; }

.pending-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.pending-card { width: min(560px, 100%); padding: clamp(30px,6vw,64px); border-radius: 42px 14px 42px 14px; background: var(--paper); box-shadow: var(--shadow); }
.pending-orbit { width: 92px; height: 92px; border: 1px solid var(--moss); border-radius: 50%; display: grid; place-items: center; margin-bottom: 34px; }
.pending-orbit::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--signal); box-shadow: 26px -20px 0 var(--moss-bright); }
.pending-card h1 { margin: 0 0 16px; font: 700 44px/1.05 var(--font-display); letter-spacing: -.045em; }
.pending-card p { color: var(--muted); line-height: 1.8; }
.pending-actions { display: flex; gap: 10px; margin-top: 28px; }

.workspace { position: relative; width: 100%; height: 100vh; min-height: 660px; overflow: hidden; background: #d8ded8; }
#map { position: absolute; inset: 0; z-index: 0; background: #ccd6ce; }
.map-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 1; box-shadow: inset 0 0 100px rgba(21,35,29,.13); }
.workspace-panel {
  position: absolute; z-index: 5; top: 16px; bottom: 16px; left: 16px;
  width: min(390px, calc(100vw - 32px)); overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid rgba(255,255,255,.7); border-radius: 30px 10px 30px 10px;
  background: rgba(247,244,236,.94); backdrop-filter: blur(22px) saturate(1.1);
  box-shadow: var(--shadow);
}
.panel-head { padding: 18px 18px 13px; border-bottom: 1px solid var(--line); }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-chip { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.56); cursor: pointer; }
.search-wrap { position: relative; margin-top: 16px; }
.search-input { min-height: 54px; padding: 0 100px 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--white); box-shadow: 0 10px 26px rgba(21,35,29,.08); }
.search-action { position: absolute; right: 6px; top: 6px; min-height: 42px; border-radius: 11px; }
.search-hint { margin: 9px 3px 0; color: var(--muted); font-size: 11px; }
.search-results { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: 310px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 18px 42px rgba(21,35,29,.18); }
.search-result { width: 100%; min-height: 58px; padding: 10px 11px; border: 0; border-radius: 11px; display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; text-align: left; background: transparent; cursor: pointer; }
.search-result:hover { background: var(--paper); }
.search-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result span { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result em { color: var(--moss); font: normal 10px/1 var(--font-mono); }
.panel-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px 112px; }
.section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.section:first-child { padding-top: 2px; }
.section-title { margin: 0 0 13px; display: flex; align-items: center; justify-content: space-between; font: 700 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--moss-bright); box-shadow: 0 0 0 5px rgba(66,197,138,.12); }
.place-card { position: relative; min-height: 148px; padding: 18px; overflow: hidden; border-radius: 22px 7px 22px 7px; color: var(--paper); background: var(--ink); }
.place-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -55px; bottom: -70px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.035); }
.place-kicker { color: var(--moss-bright); font: 700 10px/1 var(--font-mono); letter-spacing: .13em; }
.place-card h2 { position: relative; z-index: 1; margin: 12px 0 8px; font: 700 26px/1.1 var(--font-display); letter-spacing: -.03em; }
.place-address { position: relative; z-index: 1; margin: 0; color: rgba(243,240,232,.68); font-size: 12px; line-height: 1.6; }
.coordinate-row { position: relative; z-index: 1; display: flex; gap: 12px; margin-top: 16px; font: 11px/1 var(--font-mono); color: rgba(243,240,232,.82); }
.empty-place { min-height: 130px; display: grid; place-content: center; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; }
.empty-place strong { color: var(--ink); margin-bottom: 7px; }
.mini-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tab-row { display: flex; gap: 14px; margin-bottom: 12px; }
.text-tab { padding: 0 0 5px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: none; cursor: pointer; }
.text-tab.active { color: var(--ink); border-color: var(--signal); font-weight: 700; }
.place-list { display: grid; gap: 7px; }
.place-item { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; text-align: left; background: rgba(255,255,255,.48); cursor: pointer; }
.place-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-item span { grid-column: 1; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-item .remove { grid-column: 2; grid-row: 1 / 3; align-self: center; min-width: 36px; min-height: 36px; border: 0; border-radius: 10px; color: var(--danger); background: rgba(183,54,45,.07); }
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.install-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.panel-footer { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px 18px; background: linear-gradient(transparent, rgba(247,244,236,.98) 30%); }
.apply-button { width: 100%; min-height: 56px; border-radius: 17px 6px 17px 6px; font-size: 15px; }
.apply-button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.map-controls { position: absolute; z-index: 4; top: 18px; right: 18px; display: flex; gap: 8px; padding: 5px; border: 1px solid rgba(255,255,255,.7); border-radius: 14px; background: rgba(255,253,247,.88); box-shadow: 0 8px 24px rgba(21,35,29,.14); }
.map-mode { min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.map-mode.active { color: var(--paper); background: var(--ink); }
.map-config-alert { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; padding: 24px; background: #cfd8d0; }
.config-card { width: min(460px, 100%); padding: 28px; border-radius: 28px 9px 28px 9px; background: var(--paper); box-shadow: var(--shadow); }
.config-card h2 { font: 700 30px/1.1 var(--font-display); }
.config-card code { font-family: var(--font-mono); }
.location-guide-card p { margin: 12px 0; color: var(--muted); line-height: 1.65; }
.location-guide-card ol { margin: 0 0 18px; padding-left: 22px; color: var(--ink); line-height: 1.8; }
.location-guide-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.drawer-handle { display: none; }

.admin-overlay { position: fixed; z-index: 50; inset: 0; padding: 24px; display: grid; place-items: center; background: rgba(10,20,15,.58); backdrop-filter: blur(8px); }
.admin-modal { width: min(900px, 100%); max-height: min(780px, calc(100vh - 48px)); overflow: hidden; display: flex; flex-direction: column; border-radius: 34px 12px 34px 12px; background: var(--paper); box-shadow: var(--shadow); }
.modal-head { padding: 24px 26px 18px; display: flex; align-items: start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 700 32px/1 var(--font-display); }
.modal-head p { margin: 8px 0 0; color: var(--muted); }
.modal-body { padding: 20px 26px 28px; overflow: auto; }
.user-list { display: grid; gap: 9px; }
.user-row { padding: 15px; display: grid; grid-template-columns: minmax(150px,1fr) 120px 120px auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.5); }
.user-row strong { display: block; }
.user-row small { color: var(--muted); }
.badge { width: max-content; padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--paper-2); font-size: 11px; }
.badge.approved { color: #145d3d; background: rgba(66,197,138,.15); }
.badge.pending { color: #89511f; background: rgba(240,107,63,.14); }
.badge.suspended { color: var(--danger); background: rgba(183,54,45,.1); }
.row-actions { display: flex; gap: 6px; justify-content: end; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 18px; border-radius: 14px; color: var(--paper); background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; }
  .workspace { min-height: 100dvh; height: 100dvh; }
  .workspace-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 64dvh; border-radius: 28px 10px 28px 10px; transition: height .28s cubic-bezier(.2,.8,.2,1); }
  .workspace-panel.collapsed { height: 176px; }
  .workspace-panel.expanded { height: calc(100dvh - 16px); }
  .drawer-handle { width: 58px; height: 26px; margin: -8px auto 0; border: 0; display: grid; place-items: center; background: none; cursor: pointer; }
  .drawer-handle::after { content: ""; width: 30px; height: 4px; border-radius: 99px; background: rgba(21,35,29,.2); }
  .panel-head { padding: 10px 14px 10px; }
  .panel-head .brand-sub { display: none; }
  .brand-mark { width: 39px; height: 39px; border-radius: 13px 4px 13px 4px; font-size: 11px; }
  .brand-name { font-size: 18px; }
  .search-wrap { margin-top: 10px; }
  .search-input { min-height: 49px; }
  .search-action { min-height: 37px; }
  .panel-scroll { padding: 12px 14px 104px; }
  .panel-footer { padding: 12px 14px 14px; }
  .apply-button { min-height: 52px; }
  .map-controls { top: 12px; right: 12px; }
  .user-row { grid-template-columns: 1fr auto; }
  .user-row > :nth-child(2), .user-row > :nth-child(3) { display: none; }
  .admin-overlay { padding: 8px; }
  .admin-modal { max-height: calc(100dvh - 16px); border-radius: 26px 9px 26px 9px; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 520px) {
  .location-guide-actions { grid-template-columns: 1fr; }
  .auth-panel { padding: 24px; justify-content: flex-start; }
  .auth-copy { margin: 64px 0 28px; }
  .auth-copy h1 { font-size: 43px; }
  .pending-card h1 { font-size: 36px; }
  .pending-actions { flex-direction: column; }
  .map-controls { gap: 2px; }
  .map-mode { padding: 0 9px; font-size: 12px; }
  .install-grid { grid-template-columns: 1fr; }
}

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