:root {
  --green: #1F5233;
  --green-dark: #163d26;
  --green-soft: #e8f1eb;
  --ink: #26302a;
  --muted: #5f6b64;
  --bg: #fbfcfb;
  --line: #e5eae6;
  --card: #fff;
}
@property --sky-top {
  syntax: "<color>";
  inherits: true;
  initial-value: #5aa9dc;
}
@property --sky-mid {
  syntax: "<color>";
  inherits: true;
  initial-value: #87ceeb;
}
@property --sky-bot {
  syntax: "<color>";
  inherits: true;
  initial-value: #c5e8f8;
}
@property --sky-cloud {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff;
}
@property --sky-clouds {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}
@property --sky-stars {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, Segoe UI, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  --sky-rate: 1;
  --sky-top: #5aa9dc;
  --sky-mid: #87ceeb;
  --sky-bot: #c5e8f8;
  --sky-cloud: #ffffff;
  --sky-clouds: 1;
  --sky-stars: 0;
  background: var(--sky-bot);
  transition: --sky-top 0.85s ease, --sky-mid 0.85s ease, --sky-bot 0.85s ease, --sky-cloud 0.85s ease, --sky-clouds 0.85s ease, --sky-stars 0.85s ease;
}
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 42%, var(--sky-bot) 100%);
}
.bg-clouds {
  position: absolute;
  inset: 0;
  opacity: var(--sky-clouds);
}
.bg-s {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  background: var(--sky-cloud);
  will-change: transform;
}
@keyframes cloud-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(var(--cloud-dx, 140vw), var(--cloud-dy, 0px)); }
}
.sat {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.9);
  animation-name: sat-fly;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform;
}
@keyframes sat-fly {
  from { transform: translate(0, 0); }
  to { transform: translate(var(--sat-dx), var(--sat-dy)); }
}
.meteor {
  position: absolute;
  width: 88px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 72%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  transform-origin: left center;
  animation: meteor-fall 0.8s ease-out forwards;
}
@keyframes meteor-fall {
  from { opacity: 1; transform: translate(0, 0) rotate(var(--met-rot, 32deg)); }
  to { opacity: 0; transform: translate(var(--met-dx, 200px), var(--met-dy, 120px)) rotate(var(--met-rot, 32deg)); }
}
.bg-night {
  position: absolute;
  inset: 0;
  opacity: var(--sky-stars);
}
.bg-star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
  animation: twinkle calc(3.6s / var(--sky-rate)) ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-s, .bg-star, .sat, .meteor { animation: none; }
}
.top { z-index: 2; }
main { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 8px 18px;
  border-bottom: 0;
  background: transparent;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--green);
  font: 800 16px/1 Inter, system-ui, Segoe UI, sans-serif;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.top nav { display: flex; gap: 18px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.top nav a:hover { color: var(--green); }
.top .brand span:last-child,
.top nav a {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
}
body.sky-ink-light .top .brand,
body.sky-ink-light .top nav a {
  color: #f4efe8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
body.sky-ink-light .top nav a:hover { color: #fff; }
.sky-hour {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}
.sky-hour button {
  margin: 0;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.sky-hour button:hover { background: rgba(255, 255, 255, 0.45); }
.sky-hour-now {
  min-width: 72px;
  font-variant-numeric: tabular-nums;
}
.sky-hour-now.is-locked {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
body.sky-ink-light .sky-hour button {
  color: #f4efe8;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}
body.sky-ink-light .sky-hour-now.is-locked {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.main { max-width: 920px; margin: 0 auto; padding: 28px 20px 64px; }
.main-login {
  min-height: calc(100vh - 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

h1 { font-size: 28px; margin: 0 0 8px; color: var(--green-dark); }
h2 { font-size: 18px; margin: 28px 0 12px; color: var(--green); }
h3 { font-size: 15px; margin: 0 0 8px; }
.lead, .muted { color: var(--muted); }
.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(31, 82, 51, 0.08);
}
.login-brand { margin-bottom: 8px; }
.login-card label, .add-ext label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 6px;
}
input[type="password"], input[type="text"], input[type="url"], input[type="email"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
button, .card {
  font: inherit;
}
button {
  margin-top: 16px;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: var(--green-dark); }
.btn-ghost {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.err { color: #9b1c1c; background: #fdecec; padding: 8px 10px; border-radius: 8px; }
.ok { color: #1F5233; background: var(--green-soft); padding: 8px 10px; border-radius: 8px; }

.hub-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 8px;
}
.hub-head h1 { margin: 0; }
body.sky-ink-light .hub-head h1,
body.sky-ink-light .main > .muted {
  color: #f4efe8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
body.sky-ink-light .hub-sort-btn:not(.is-on) {
  color: #f4efe8;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}
body.sky-ink-light .hub-sort-btn:not(.is-on):hover { background: rgba(255, 255, 255, 0.2); }
.hub-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hub-sort-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--green);
  background: transparent;
  color: var(--green);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.hub-sort-btn:hover { background: var(--green-soft); }
.hub-sort-btn.is-on {
  background: var(--green);
  color: #fff;
}
.hub-group {
  margin-top: 18px;
  padding: 16px 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(31, 82, 51, 0.06);
}
.hub-group h2 { margin: 0 0 4px; }
.hub-group .grid { margin-top: 12px; }
.hub-group .muted { margin: 10px 0 0; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  min-height: 92px;
  box-shadow: 0 1px 2px rgba(31, 82, 51, 0.06), 0 8px 24px rgba(31, 82, 51, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(31, 82, 51, 0.08), 0 14px 32px rgba(31, 82, 51, 0.14);
}
.card:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.card-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 800;
  color: hsl(var(--hue, 145) 45% 28%);
  background: hsl(var(--hue, 145) 55% 92%);
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.card-title {
  font-size: 16px;
  line-height: 1.3;
  color: var(--green-dark);
  overflow-wrap: anywhere;
}
.card-desc {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green);
  background: var(--green-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
.card-icon-emoji {
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}
.label-cell > input { margin-top: 6px; font-size: 13px; }
.label-row { display: flex; gap: 6px; }
.icon-input {
  flex: none;
  width: 48px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center;
  font-size: 20px !important;
  cursor: pointer;
}
.add-ext .icon-input { display: block; }
.emoji-palette {
  position: absolute;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(10, 36px);
  gap: 4px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(31, 82, 51, 0.18);
}
.emoji-palette[hidden] { display: none; }
.emoji-palette button {
  margin: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
}
.emoji-palette button:hover { background: var(--green-soft); }
.emoji-palette .emoji-clear { font-size: 13px; font-weight: 700; color: var(--green); }
@media (max-width: 480px) {
  .emoji-palette { grid-template-columns: repeat(7, 36px); }
}
.new-folders {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(31, 82, 51, 0.06);
}
.new-folders h2 { margin: 0 0 2px; }
.new-folders .muted { margin: 0 0 8px; font-size: 13px; }
.new-folder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.new-folder code { font-size: 15px; font-weight: 700; }
.new-folder-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.new-folder-actions button { margin: 0; padding: 8px 12px; font-size: 13px; }
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
  padding: 12px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 -6px 18px rgba(31, 82, 51, 0.1);
}
.save-bar button { margin: 0; }
.save-bar-note { font-size: 13px; color: var(--muted); }
.save-bar.is-dirty { border-color: var(--green); }
.save-bar.is-dirty .save-bar-note { color: var(--green-dark); font-weight: 700; }

.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: middle; }
.tbl .url { font-size: 13px; word-break: break-all; color: var(--muted); }
.add-ext {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--green-soft);
}
.guest-box {
  margin: 8px 0 28px;
  padding: 16px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.guest-box > h2:first-child { margin-top: 0; }
.guest-issue {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.guest-issue label { margin: 0; }
.guest-issue input[type="number"] { width: 96px; }
.guest-issue button { margin-top: 0; }
.guest-box .tbl { margin-top: 12px; }
.guest-box .btn-ghost { margin-top: 0; }
.guest-box h3 { margin: 18px 0 8px; }
.login-links {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-links a { color: var(--green); font-weight: 600; }
.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.people-actions-row td {
  border-top: 0;
  padding-top: 0;
  padding-bottom: 16px;
}
.people-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.people-actions button { margin-top: 0; }
.people-actions select { width: auto; min-width: 140px; }
.link-copy {
  display: flex;
  gap: 8px;
  align-items: center;
}
.link-copy input { margin: 0; }
.link-copy button { margin-top: 0; flex: none; }
.proj-tbl {
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}
.proj-tbl thead th {
  border-bottom: 0;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.proj-group + .proj-group tr:first-child td {
  border-top-width: 12px;
  border-top-color: #fff;
}
.proj-group td {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.proj-group td:first-child { border-left: 1px solid var(--line); }
.proj-group td:last-child { border-right: 1px solid var(--line); }
.proj-group:not(.vis-hidden) .allow-row { display: none; }
.proj-group tr:first-child td:first-child { border-radius: 12px 0 0 12px; }
.proj-group tr:first-child td:last-child { border-radius: 0 12px 12px 0; }
.proj-group.vis-hidden td { background: #f3f7f4; }
.proj-group.vis-hidden td:first-child {
  box-shadow: inset 4px 0 0 var(--green);
  padding-left: 14px;
}
.proj-group.vis-hidden tr:first-child td:first-child { border-radius: 12px 0 0 0; }
.proj-group.vis-hidden tr:first-child td:last-child { border-radius: 0 12px 0 0; }
.proj-group.vis-hidden tr:first-child td { border-bottom: 0; }
.proj-group .allow-row td {
  background: #f3f7f4;
  border-top: 0;
  padding: 6px 14px 12px 22px;
  border-radius: 0 0 12px 12px;
  box-shadow: inset 4px 0 0 var(--green);
}
.allow-hint {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.allow-hint strong { font-weight: 800; color: var(--ink); }
.allow-people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}
.allow-people label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  font-size: 13px;
}
.allow-people input { width: auto; margin: 0; }
code { font-size: 13px; }
