/* ARUI Studio (D-52; simplified in task 8.8): phone first, three tabs (Ideas · Edit · Usage),
   ARUI's dark brand (arui.gr palette, Manrope), big tap targets within thumb reach, plain words. */
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-variable.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --ink: #04060a;
  --panel: #0c1118;
  --panel-2: #121925;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --fg: #ffffff;
  --sv: #ebeff3;
  --muted: #8c99a3;
  --accent: #ebeff3;
  --go: #35d6a4;
  --go-ink: #04140f;
  --warn: #e4a755;
  --warn-bg: rgba(228, 167, 85, 0.13);
  --bad: #f07d74;
  --bad-bg: rgba(240, 125, 116, 0.13);
  --ok-bg: rgba(53, 214, 164, 0.12);
  --r: 14px;
  --tabbar: 66px;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  background: var(--ink);
  color: var(--sv);
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
h1,
h2,
h3 {
  margin: 0;
  color: var(--fg);
  line-height: 1.25;
  text-wrap: balance;
}
h1 {
  font-size: 24px;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 16px;
}
p {
  margin: 0;
}
a {
  color: var(--sv);
  overflow-wrap: anywhere;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--go);
  outline-offset: 2px;
}

/* shell */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(4, 6, 10, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.top img {
  height: 20px;
}
.top .title {
  font-weight: 800;
  color: var(--fg);
  font-size: 15px;
}
.top .pc {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  max-width: 60%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 14px;
}
.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(7, 10, 15, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar button {
  background: none;
  border: 0;
  height: var(--tabbar);
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
  gap: 0;
  cursor: pointer;
  position: relative;
}
.tabbar .ico {
  font-size: 21px;
  line-height: 1;
}
.tabbar button[aria-current='page'] {
  color: var(--fg);
}
.tabbar button[aria-current='page']::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--go);
}

/* blocks */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.card > * {
  min-width: 0;
}
.tap {
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
.label {
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--muted);
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--sv);
  white-space: nowrap;
}
.chip.go {
  background: var(--ok-bg);
  border-color: transparent;
  color: var(--go);
}
.chip.warn {
  background: var(--warn-bg);
  border-color: transparent;
  color: var(--warn);
}
.chip.bad {
  background: var(--bad-bg);
  border-color: transparent;
  color: var(--bad);
}

/* buttons */
.btn {
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--fg);
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn.primary {
  background: var(--go);
  border-color: var(--go);
  color: var(--go-ink);
}
.btn.big {
  min-height: 58px;
  font-size: 17px;
}
.btn.wide {
  width: 100%;
}
.btn.ghost {
  background: none;
}
.btn.small {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 14px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.back {
  background: none;
  border: 0;
  color: var(--muted);
  font-weight: 800;
  padding: 4px 0;
  cursor: pointer;
  justify-self: start;
}

/* form */
textarea,
input[type='text'],
input[type='password'] {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.45;
}
textarea {
  min-height: 140px;
  resize: vertical;
}
.choice {
  display: grid;
  gap: 8px;
}
.choice button {
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--sv);
  cursor: pointer;
  display: grid;
  gap: 2px;
}
.choice button b {
  color: var(--fg);
}
.choice button[aria-pressed='true'] {
  border-color: var(--go);
  box-shadow: inset 0 0 0 1px var(--go);
}

/* messages */
.msg {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
}
.msg.ok {
  background: var(--ok-bg);
}
.msg.warn {
  background: var(--warn-bg);
}
.msg.err {
  background: var(--bad-bg);
}
.msg ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* progress */
.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--go);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--go);
  animation: spin 0.9s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* video */
video {
  width: 100%;
  max-height: 72vh;
  border-radius: 12px;
  background: #000;
  display: block;
}
.lines {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lines li {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 15px;
}
.lines li.cta {
  color: var(--muted);
}
.lines li button {
  all: unset;
  cursor: pointer;
  display: block;
  width: 100%;
}
.clips {
  display: grid;
  gap: 6px;
}
.clips .clip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 10px;
  font-size: 15px;
}
.clips .clip .grow {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.caption {
  white-space: pre-wrap;
  font-size: 15px;
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 14px;
}
.chat {
  display: grid;
  gap: 8px;
}
.chat .me {
  justify-self: end;
  background: var(--panel-2);
  border-radius: 14px 14px 4px 14px;
  padding: 10px 12px;
  max-width: 88%;
}
.chat .claude {
  justify-self: start;
  background: var(--ok-bg);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 12px;
  max-width: 92%;
}
.meter {
  display: grid;
  gap: 6px;
}
.meter .row b {
  color: var(--fg);
}
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom, 0px));
  z-index: 9;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.toast.err {
  border-color: var(--bad);
}
.toast.ok {
  border-color: var(--go);
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login .card {
  width: 100%;
  max-width: 400px;
}
.login img {
  height: 26px;
}
.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}
details > summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--fg);
}

/* the Edit list: a thumbnail beside each video */
.vrow {
  display: flex;
  gap: 14px;
  align-items: center;
}
.thumb {
  width: 64px;
  height: 114px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--panel-2);
  flex: none;
}
.empty-thumb {
  display: grid;
  place-items: center;
  font-size: 22px;
}

/* selecting many: the ticks, the picked cards, the action bar above the tabs */
.tick {
  font-size: 20px;
  margin-right: 8px;
  color: var(--go);
}
.card.picked,
.card:has(.tick) .picked {
  border-color: var(--go);
}
.selbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  max-width: 696px;
  margin: 0 auto;
  background: var(--panel-2);
  border: 1px solid var(--go);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}
.btn.danger {
  color: var(--bad);
}
