:root {
  --ink: #122033;
  --muted: #65748a;
  --line: #dfe8f2;
  --line-strong: #cbd9e8;
  --page: #eaf2f9;
  --surface: #ffffff;
  --surface-soft: #f6faff;
  --blue: #2688e8;
  --blue-dark: #126bc4;
  --blue-soft: #e6f3ff;
  --green: #2fbf83;
  --green-soft: #e6f8ef;
  --yellow: #fff4cb;
  --yellow-line: #efd77a;
  --danger: #e45858;
  --shadow: 0 16px 38px rgba(35, 88, 128, 0.16);
  --soft-shadow: 0 8px 20px rgba(35, 88, 128, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mock-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.phone-shell {
  position: relative;
  width: 390px;
  height: 844px;
  padding: 12px;
  background: #0f2235;
  border-radius: 42px;
  box-shadow: 0 30px 70px rgba(18, 32, 51, 0.24);
}

.phone-speaker {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 6;
  width: 74px;
  height: 5px;
  background: rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  transform: translateX(-50%);
}

.app {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--page);
  border-radius: 32px;
  isolation: isolate;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.login-screen {
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: #ffffff;
  background: #1189dc;
}

.login-screen.is-exiting {
  opacity: 0;
  transform: scale(0.98);
}

.login-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #2cbff0 0%, #0a71c8 54%, #0755ab 100%);
}

.surface,
.line {
  position: absolute;
  display: block;
  pointer-events: none;
}

.surface {
  width: 280px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(-18deg);
}

.surface-a {
  top: -58px;
  right: -128px;
}

.surface-b {
  left: -142px;
  bottom: 90px;
}

.line {
  width: 210px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.line-a {
  top: 132px;
  left: -48px;
  transform: rotate(-26deg);
}

.line-b {
  right: -34px;
  bottom: 214px;
  transform: rotate(-26deg);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 30px 24px 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  box-shadow: 0 28px 54px rgba(4, 44, 99, 0.22);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  text-align: center;
}

.brand-mark,
.company-mark {
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.brand-mark {
  width: 70px;
  height: 70px;
  margin: 0 auto 14px;
  border-radius: 22px;
}

.brand-mark svg,
.company-mark svg {
  width: 34px;
  height: 34px;
}

.brand-mark path:first-child,
.company-mark path:first-child {
  fill: currentColor;
  stroke: none;
  opacity: 0.18;
}

.workspace-kicker,
.section-label {
  margin: 0;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.brand-lockup .workspace-kicker {
  color: rgba(255, 255, 255, 0.74);
}

.brand-lockup h1 {
  margin: 3px 0 4px;
  font-size: 27px;
  line-height: 1.25;
}

.brand-lockup p:last-child {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  outline: none;
}

.login-form input:focus,
.compose-input textarea:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14);
}

.primary-action,
.secondary-action,
.danger-action {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-action {
  min-height: 52px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 17px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(24, 109, 214, 0.28);
}

.login-form .primary-action {
  margin-top: 8px;
  color: var(--blue-dark);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(4, 56, 113, 0.2);
}

.primary-action:active,
.secondary-action:active,
.danger-action:active,
.dock-button:active,
.voice-button:active,
.icon-button:active,
.add-sheet button:active,
.compose-tools button:active {
  transform: scale(0.97);
}

.primary-action.is-loading span {
  opacity: 0.68;
}

.text-link {
  display: block;
  margin: 15px auto 0;
  padding: 6px 8px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  border: 0;
  font-size: 12px;
}

.home-screen {
  background: var(--page);
  transform: translateY(0);
}

.home-screen.is-layered {
  transform: scale(0.965);
  filter: saturate(0.9);
}

.home-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 10px;
}

.company-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-mark {
  width: 44px;
  height: 44px;
  color: var(--blue);
  background: #ffffff;
  border-color: var(--line);
  border-radius: 15px;
  box-shadow: var(--soft-shadow);
}

.company-row p,
.compose-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.company-row strong {
  display: block;
  margin-top: 1px;
  font-size: 15px;
}

.icon-button,
.dock-button,
.voice-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: #ffffff;
  border-radius: 15px;
  box-shadow: var(--soft-shadow);
}

.icon-button.ghost {
  color: var(--blue-dark);
}

.dot {
  position: absolute;
  top: 11px;
  right: 12px;
  width: 7px;
  height: 7px;
  background: var(--green);
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.greeting-panel {
  padding: 0 20px 12px;
}

.date-line {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.greeting-panel h2 {
  margin: 0 0 11px;
  font-size: 27px;
  line-height: 1.22;
}

.sync-chip,
.live-pill,
.soft-count,
.status-good {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.sync-chip {
  color: #15744f;
  background: var(--green-soft);
}

.sync-chip svg {
  width: 16px;
  height: 16px;
}

.main-deck {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 134px;
  scroll-behavior: smooth;
}

.deck-card,
.site-section {
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}

.deck-card {
  padding: 17px;
}

.card-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-heading h3,
.section-heading h3 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.25;
}

.live-pill {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.soft-count {
  color: #17734f;
  background: var(--green-soft);
}

.status-good {
  color: #17734f;
  background: var(--green-soft);
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline-item time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.timeline-item > div {
  position: relative;
  padding-left: 14px;
}

.timeline-item > div::before {
  position: absolute;
  top: 6px;
  left: 0;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--line-strong);
  border-radius: 50%;
}

.timeline-item.current > div::before {
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.timeline-item strong {
  display: block;
  font-size: 15px;
}

.timeline-item p,
.action-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.memo-list {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 15px 0 0;
  list-style: none;
}

.memo-list li {
  position: relative;
  padding-left: 20px;
  color: #314157;
  font-size: 14px;
}

.memo-list li::before {
  position: absolute;
  top: 8px;
  left: 0;
  width: 8px;
  height: 8px;
  content: "";
  background: var(--green);
  border-radius: 50%;
}

.site-section {
  padding: 17px 0 16px;
  overflow: hidden;
}

.section-heading {
  padding: 0 17px;
}

.section-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-carousel {
  display: grid;
  grid-auto-columns: 82%;
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding: 15px 17px 3px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.site-carousel::-webkit-scrollbar,
.main-deck::-webkit-scrollbar {
  display: none;
}

.site-card {
  min-height: 174px;
  padding: 15px;
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  scroll-snap-align: center;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.site-card.is-selected {
  background: var(--yellow);
  border-color: var(--yellow-line);
  box-shadow: 0 12px 26px rgba(194, 154, 34, 0.18);
}

.site-card:active {
  transform: scale(0.985);
}

.site-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.selected-badge,
.site-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.selected-badge {
  color: #866200;
  background: rgba(255, 255, 255, 0.62);
}

.site-state {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.site-card h4 {
  margin: 12px 0 4px;
  font-size: 18px;
}

.site-card .site-time {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.site-card .site-memo {
  min-height: 38px;
  margin: 10px 0 12px;
  color: #40516a;
  font-size: 13px;
}

.site-meta {
  display: flex;
  gap: 8px;
}

.site-meta span {
  padding: 5px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.input-dock {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 8;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(203, 217, 232, 0.76);
  border-radius: 28px;
  box-shadow: 0 18px 34px rgba(35, 88, 128, 0.18);
  backdrop-filter: blur(18px);
}

.selected-context {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.selected-context strong {
  color: var(--ink);
}

.dock-actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr 1fr;
  gap: 10px;
  align-items: center;
}

.dock-button {
  min-height: 52px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-radius: 18px;
}

.voice-button {
  min-height: 64px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 23px;
  box-shadow: 0 12px 24px rgba(18, 107, 196, 0.3);
}

.voice-button svg {
  width: 28px;
  height: 28px;
}

.scrim {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(18, 32, 51, 0.2);
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.scrim.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.layer,
.layer-full {
  position: absolute;
  z-index: 12;
  background: #ffffff;
  box-shadow: 0 -22px 46px rgba(18, 32, 51, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 230ms ease, transform 230ms ease;
}

.layer {
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  transform: translateY(24px);
}

.layer.is-open,
.layer-full.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.layer-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 14px;
  background: #d8e4ef;
  border-radius: 999px;
}

.voice-panel h2,
.transcript-panel h2 {
  margin: 2px 0 8px;
  font-size: 24px;
}

.record-context {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.record-context strong {
  color: var(--ink);
}

.timer {
  margin: 18px 0 10px;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.waveform {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 18px;
}

.waveform span {
  width: 6px;
  height: 14px;
  background: var(--blue);
  border-radius: 999px;
  animation: wave 900ms ease-in-out infinite;
}

.waveform span:nth-child(2) {
  animation-delay: 120ms;
}

.waveform span:nth-child(3) {
  animation-delay: 240ms;
}

.waveform span:nth-child(4) {
  animation-delay: 360ms;
}

.waveform span:nth-child(5) {
  animation-delay: 480ms;
}

.waveform span:nth-child(6) {
  animation-delay: 600ms;
}

@keyframes wave {
  0%,
  100% {
    height: 12px;
  }

  50% {
    height: 36px;
  }
}

.voice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.transcript-panel .voice-actions {
  grid-template-columns: 0.9fr 0.9fr 1.1fr;
}

.secondary-action,
.danger-action {
  min-height: 48px;
  border-radius: 16px;
  font-weight: 800;
}

.secondary-action {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.danger-action {
  color: #ffffff;
  background: var(--danger);
}

.primary-action.compact {
  min-height: 48px;
  border-radius: 16px;
}

blockquote {
  margin: 16px 0;
  padding: 16px;
  color: #26364d;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.layer-full {
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 20px;
  border-radius: 32px;
  transform: translateY(100%);
}

.compose-header {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.compose-header .icon-button {
  color: var(--ink);
  background: var(--surface-soft);
  box-shadow: none;
}

.compose-header h2 {
  margin: 0;
  font-size: 23px;
}

.compose-input {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compose-input textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 260px;
  padding: 16px;
  resize: none;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  outline: none;
}

.compose-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.compose-tools button,
.add-sheet button {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 17px;
  font-weight: 800;
}

.add-sheet {
  display: grid;
  gap: 10px;
}

.toast {
  position: absolute;
  right: 24px;
  bottom: 118px;
  left: 24px;
  z-index: 20;
  padding: 12px 14px;
  color: #ffffff;
  background: rgba(18, 32, 51, 0.9);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 540px) {
  .mock-stage {
    padding: 0;
  }

  .phone-shell {
    width: 100vw;
    height: 100svh;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-speaker {
    display: none;
  }

  .app,
  .layer-full {
    border-radius: 0;
  }
}

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