:root {
  color-scheme: light;
  --ink: #101b19;
  --muted: #5f6f6b;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --surface-soft: #fbfaf6;
  --line: #ddd8cc;
  --moss: #062f2b;
  --moss-2: #0f4b44;
  --teal: #159c94;
  --coral: #ff614d;
  --gold: #dca51d;
  --shadow: 0 24px 74px rgba(16, 27, 25, 0.14);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(115deg, rgba(21, 156, 148, 0.16), transparent 34rem),
    linear-gradient(245deg, rgba(255, 97, 77, 0.13), transparent 28rem),
    linear-gradient(180deg, #fffdf8 0%, #f0ece2 100%);
  color: var(--ink);
  font-family: var(--font);
}

button,
select,
textarea,
input {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  place-items: start center;
  padding: clamp(0px, 4vw, 36px);
}

.phone-surface {
  position: relative;
  overflow: hidden;
  width: min(100%, 440px);
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)),
    var(--surface-soft);
  border: 1px solid rgba(221, 216, 204, 0.92);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(221, 216, 204, 0.82);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  font-size: clamp(1.34rem, 5.7vw, 1.9rem);
  font-weight: 760;
  letter-spacing: 0;
}

.brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark,
.icon-button,
.mic-button,
.project-icon {
  display: grid;
  place-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(21, 156, 148, 0.9), transparent 48%),
    var(--moss);
  color: #fffaf2;
  font-size: 1.28rem;
  font-weight: 820;
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(221, 216, 204, 0.88);
  border-radius: 999px;
  background: #f3f0e8;
  color: var(--moss);
}

.icon-button svg,
.action-button svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.1;
}

.project-form,
.recent-section {
  display: grid;
  gap: 28px;
  padding: 24px 22px 0;
}

.composer-section {
  display: grid;
  gap: 12px;
}

.composer-section label,
.section-title h1,
.section-title h2,
.recent-header h2 {
  margin: 0;
  font-size: 1.38rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.composer-section label,
.section-title h1,
.section-title h2 {
  font-weight: 720;
}

.composer {
  position: relative;
  min-height: 250px;
  border: 1px solid #d9d3c5;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 44px rgba(16, 27, 25, 0.08);
}

.composer textarea {
  width: 100%;
  min-height: 250px;
  padding: 22px 22px 84px;
  border: 0;
  border-radius: var(--radius);
  resize: vertical;
  background: transparent;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.48;
}

.composer textarea:focus {
  outline: 3px solid rgba(21, 156, 148, 0.2);
}

.mic-button {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 66px;
  height: 66px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--coral), #ff7d65);
  color: #fff;
  box-shadow: 0 16px 34px rgba(255, 97, 77, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.mic-button:hover {
  transform: translateY(-2px);
}

.mic-button.is-listening {
  background: linear-gradient(135deg, var(--teal), var(--moss-2));
  box-shadow: 0 16px 34px rgba(21, 156, 148, 0.26);
}

.mic-button svg {
  width: 30px;
  height: 30px;
}

.char-count {
  position: absolute;
  left: 20px;
  bottom: 28px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f0eee8;
  color: #2c3835;
  font-size: 0.83rem;
  font-weight: 620;
}

.voice-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-title svg {
  width: 20px;
  height: 20px;
  color: var(--moss-2);
}

.section-title.accent svg {
  color: var(--teal);
}

.quality-section,
.brief-section,
.handoff-section {
  display: grid;
  gap: 18px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.control-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.control-grid span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #2d3c39;
  font-size: 0.88rem;
  font-weight: 680;
}

.control-grid svg {
  width: 16px;
  height: 16px;
}

.control-grid select {
  width: 100%;
  min-height: 48px;
  padding: 0 30px 0 11px;
  border: 1px solid #d7d0c3;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 620;
  box-shadow: 0 9px 22px rgba(16, 27, 25, 0.06);
}

.brief-card {
  overflow: hidden;
  border: 1px solid rgba(221, 216, 204, 0.95);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 27, 25, 0.08);
}

.brief-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--moss);
}

.brief-copy {
  display: grid;
  gap: 12px;
  padding: 18px 18px 20px;
}

.project-type {
  margin: 0;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-copy h3 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.brief-copy ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief-copy li {
  position: relative;
  padding-left: 27px;
  color: #2f403c;
  font-size: 0.96rem;
  line-height: 1.36;
}

.brief-copy li::before {
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid rgba(21, 156, 148, 0.45);
  border-radius: 999px;
  color: var(--teal);
  content: "✓";
  font-size: 0.72rem;
  font-weight: 820;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.handoff-section {
  padding: 18px;
  border: 1px solid rgba(221, 216, 204, 0.95);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(21, 156, 148, 0.09), transparent 48%),
    #fff;
  box-shadow: 0 14px 36px rgba(16, 27, 25, 0.07);
}

.agent-field {
  display: grid;
  gap: 8px;
}

.agent-field span {
  color: #2d3c39;
  font-size: 0.88rem;
  font-weight: 720;
}

.agent-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #d7d0c3;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 620;
}

.agent-field input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(21, 156, 148, 0.18);
}

.handoff-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid rgba(6, 47, 43, 0.2);
  border-radius: var(--radius);
  background: #f8f6f0;
  color: var(--moss);
  font-weight: 760;
}

.mini-button svg {
  width: 18px;
  height: 18px;
}

.handoff-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  border-radius: var(--radius);
  font-weight: 760;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.action-button:hover {
  transform: translateY(-2px);
}

.action-button.secondary {
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
}

.action-button.dark {
  border: 1px solid transparent;
  background: var(--moss);
  color: #fffaf2;
}

.action-button.primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--coral), #ff7d65);
  color: #fff;
  box-shadow: 0 14px 30px rgba(255, 97, 77, 0.2);
}

.recent-section {
  padding-bottom: 34px;
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.recent-header h2 {
  font-weight: 720;
}

.recent-header button {
  border: 0;
  background: transparent;
  color: var(--moss-2);
  font-weight: 720;
}

.recent-list {
  display: grid;
}

.recent-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  border-top: 1px solid rgba(221, 216, 204, 0.8);
}

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal), var(--moss));
  color: #fff;
}

.recent-item:nth-child(2n) .project-icon {
  background: linear-gradient(135deg, var(--gold), #c58515);
}

.recent-item h3,
.recent-item p {
  margin: 0;
}

.recent-item h3 {
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.recent-badge {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(21, 156, 148, 0.13);
  color: var(--moss);
  font-size: 0.8rem;
  font-weight: 720;
}

.recent-badge[data-status="Kladd"] {
  background: rgba(220, 165, 29, 0.16);
}

.recent-badge[data-status="Sendt"] {
  background: rgba(21, 156, 148, 0.15);
}

.recent-badge[data-status="Dashboard"] {
  background: rgba(255, 97, 77, 0.14);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 10;
  max-width: 420px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(6, 47, 43, 0.96);
  color: #fffaf2;
  font-weight: 680;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 620px) {
  .phone-surface {
    min-height: auto;
    border-radius: 28px;
  }

  .action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .topbar,
  .project-form,
  .recent-section {
    padding-inline: 16px;
  }

  .brand {
    font-size: 1.28rem;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .control-grid {
    grid-template-columns: 1fr;
  }
}
