/* Slipora — Clipboard Focus Stack theme */

:root {
  --paper: #f7ebcf;
  --paper-deep: #efe0bd;
  --card: #fdf7e4;
  --ink: #2e2a24;
  --ink-soft: #75695432;
  --text-soft: #6f6653;
  --coral: #e2663b;
  --teal: #3c5a66;
  --charcoal: #3a3530;
  --marigold: #e69a3c;
  --marigold-deep: #c9812c;
  --rule: rgba(60, 90, 102, 0.14);
  --edge-w: 7px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 27px,
    var(--rule) 27px 28px
  );
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- layout ---------- */

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px);
}

.tabpane[hidden] { display: none; }

.pane-head h1 {
  font-size: 1.45rem;
  margin: 8px 0 2px;
  letter-spacing: 0.02em;
}
.head-hint {
  margin: 0 0 14px;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-soft);
}

/* ---------- clip silhouette ---------- */

.clip {
  display: inline-block;
  width: 30px;
  height: 15px;
  background: var(--teal);
  clip-path: polygon(24% 0, 76% 0, 100% 100%, 0 100%);
  position: relative;
}
.clip::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -4px;
  height: 4px;
  background: var(--charcoal);
}
.clip-big { width: 44px; height: 20px; }

/* ---------- focus: clipboard header ---------- */

.focus-cliphead {
  text-align: center;
  padding-top: 10px;
  margin-bottom: 6px;
}
.cliphead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 2px 12px;
}
.wordmark {
  font-size: 1.7rem;
  margin: 0;
  letter-spacing: 0.03em;
  color: var(--teal);
}
.open-chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: bold;
  color: var(--card);
  background: var(--teal);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.add-strip {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--marigold);
  color: #3a2410;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: bold;
  letter-spacing: 0.03em;
  padding: 16px 12px;
  min-height: 52px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--marigold-deep);
}
.add-strip:active { transform: translateY(1px); box-shadow: none; }

/* ---------- slips ---------- */

.slip {
  position: relative;
  background: var(--card);
  border-left: var(--edge-w) solid var(--charcoal);
  padding: 12px 18px 12px 14px;
  margin: 0 0 12px;
}

/* torn right edge */
.slip::after {
  content: "";
  position: absolute;
  top: 0;
  right: -5px;
  width: 5px;
  height: 100%;
  background-image:
    linear-gradient(45deg, var(--card) 25%, transparent 25%),
    linear-gradient(-45deg, transparent 75%, var(--card) 75%);
  background-size: 7px 7px;
}

.slip.edge-todo    { border-left-color: var(--coral); }
.slip.edge-working { border-left-color: var(--teal); }
.slip.edge-done    { border-left-color: var(--charcoal); }

.stage-word {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sw-todo    { color: var(--coral); }
.sw-working { color: var(--teal); }
.sw-done    { color: var(--charcoal); }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid currentColor;
  background: transparent;
}
.dot.d-fill { background: currentColor; }

/* focus: next-up card */

.focus-next-label {
  margin: 20px 0 8px;
  font-size: 0.78rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}
.next-card { cursor: pointer; }
.next-card .next-title {
  font-size: 1.2rem;
  margin: 6px 0 2px;
}
.next-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
}
.next-cue {
  margin: 10px 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--teal);
}
.next-tap-hint {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--text-soft);
  opacity: 0.75;
}

/* ---------- queue lanes ---------- */

.lane { margin-bottom: 18px; }
.lane-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 2px 8px;
}
.lane-head h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0;
}
.lane-count {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.slip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-left: var(--edge-w) solid var(--charcoal);
  padding: 10px 10px 10px 12px;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.slip-row.edge-todo    { border-left-color: var(--coral); }
.slip-row.edge-working { border-left-color: var(--teal); }
.slip-row.edge-done    { border-left-color: var(--charcoal); }

.row-main { flex: 1; min-width: 0; }
.row-title {
  display: block;
  font-weight: bold;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-subj {
  display: block;
  font-size: 0.8rem;
  color: var(--text-soft);
}
.row-stage {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.row-stage .dot { width: 7px; height: 7px; border-width: 1.5px; }

.row-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
}
.row-btn {
  font-family: inherit;
  font-size: 0.74rem;
  padding: 7px 9px;
  min-width: 40px;
  min-height: 34px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-deep);
  color: var(--ink);
  cursor: pointer;
}
.row-btn.danger { color: var(--coral); border-color: rgba(226, 102, 59, 0.4); }

/* ---------- add form (index card) ---------- */

.index-card {
  background: var(--card);
  border: 1px solid rgba(60, 90, 102, 0.18);
  border-radius: 4px 4px 10px 10px;
  box-shadow: 0 3px 8px rgba(60, 90, 102, 0.12);
  padding: 18px 16px;
  display: grid;
  gap: 16px;
}
.field { display: block; }
.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
  color: var(--teal);
}
.field-label .req { font-weight: normal; text-transform: none; color: var(--coral); font-style: italic; }
.field-label .opt { font-weight: normal; text-transform: none; color: var(--text-soft); font-style: italic; }

input[type="text"], input[type="search"] {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fffdf3;
  border: 1px solid rgba(60, 90, 102, 0.28);
  border-radius: 6px;
  padding: 12px;
  min-height: 48px;
}
input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}
input::placeholder { color: #a49a82; font-style: italic; }

.stage-pick { border: none; margin: 0; padding: 0; }
.stage-pick legend { padding: 0; }
.stage-btns { display: flex; gap: 8px; }
.stage-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.86rem;
  padding: 12px 4px;
  min-height: 46px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-deep);
  color: var(--ink);
  cursor: pointer;
}
.stage-btn.is-on { background: var(--teal); color: var(--card); border-color: var(--teal); }
.stage-btn.is-on .dot { border-color: var(--card); color: var(--card); }

.form-error {
  margin: 0;
  font-size: 0.88rem;
  color: var(--coral);
  font-weight: bold;
}

.form-btns { display: flex; gap: 10px; }
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 50px;
  cursor: pointer;
}
.btn-save { flex: 2; background: var(--teal); color: var(--card); }
.btn-save:active { transform: translateY(1px); }
.btn-clear { flex: 1; background: var(--paper-deep); color: var(--ink); border: 1px solid var(--rule); }

/* ---------- find ---------- */

.search-wrap { margin-bottom: 14px; }
#search-input { border-radius: 999px; }

.result-head {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin: 4px 2px 10px;
}

.about-card {
  margin-top: 26px;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px;
}
.about-card h2 {
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--teal);
}
.about-card p { font-size: 0.88rem; line-height: 1.5; margin: 0 0 14px; }
.btn-reset {
  background: var(--card);
  color: var(--coral);
  border: 1px solid rgba(226, 102, 59, 0.45);
  width: 100%;
}

/* ---------- empty states ---------- */

.empty {
  padding: 22px 10px;
  text-align: center;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-soft);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 10px,
    var(--rule) 10px 11px
  );
  background-size: 70% 44px;
  background-repeat: no-repeat;
  background-position: center top;
  padding-top: 52px;
  border-radius: 6px;
}
.empty-short { padding-top: 20px; background-size: 50% 12px; }

/* ---------- bottom tab bar ---------- */

#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper-deep);
  border-top: 1px solid rgba(60, 90, 102, 0.25);
  box-shadow: 0 -3px 10px rgba(46, 42, 36, 0.1);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  padding-top: 6px;
}
.tab .clip { filter: grayscale(0.6) brightness(0.9); opacity: 0.75; }
.tab.is-active {
  color: var(--teal);
  font-weight: bold;
}
.tab.is-active .clip {
  filter: none;
  opacity: 1;
  transform: translateY(3px);
  filter: drop-shadow(0 3px 3px rgba(46, 42, 36, 0.35));
}

/* ---------- toast ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%);
  z-index: 20;
  background: var(--charcoal);
  color: var(--card);
  font-size: 0.86rem;
  padding: 10px 18px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(46, 42, 36, 0.3);
}
