.app-page {
  background: var(--bg);
}

.app-page .app-header,
.app-page .app-shell {
  width: min(100% - 48px, 1240px);
}

.app-page .app-header {
  gap: 32px;
}

.app-page .app-header nav {
  margin-left: 20px;
}

.app-page .app-header nav a {
  display: inline-flex;
  min-height: var(--web-control-min-height);
  align-items: center;
}

.app-page .account-button {
  min-height: var(--web-control-min-height);
  margin-left: auto;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-subtle);
}

.app-page .app-shell {
  padding: 44px 0 32px;
}

.app-page .intro {
  display: flex;
  max-width: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.app-page .intro .eyebrow {
  margin-bottom: 8px;
}

.app-page .intro h1 {
  max-width: none;
  margin-bottom: 10px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.app-page .intro > div > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.session-note {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.session-note .session-indicator {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand-primary-strong);
}

.app-page .workspace-grid {
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 24px;
}

.workspace-main {
  min-width: 0;
}

.app-page .composer-panel,
.app-page .links-section,
.app-page .detail-view {
  border-radius: 12px;
  background: var(--surface);
}

.app-page .composer-panel {
  padding: 24px;
  border-color: rgba(51, 156, 255, 0.32);
  box-shadow: 0 12px 36px rgba(24, 33, 31, 0.08);
}

.composer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.composer-heading h2,
.app-page .section-heading-row h2 {
  margin: 0;
  font-size: 20px;
}

.composer-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.app-page .url-field {
  min-width: 0;
  margin: 0;
}

.app-page .input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
  gap: 0;
  padding: 5px;
  padding-left: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.app-page .input-action-row:focus-within {
  border-color: var(--focus);
  outline: 3px solid rgba(11, 116, 201, 0.18);
  outline-offset: 1px;
}

.app-page .input-action-row input {
  min-width: 0;
  min-height: var(--web-control-min-height);
  border: 0;
  outline: 0;
  font-size: 16px;
}

.app-page .paste-button {
  min-width: 76px;
  min-height: var(--web-control-min-height);
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-subtle);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.app-page #submit-button {
  width: auto;
  min-width: 184px;
  min-height: 56px;
  margin-top: 24px;
  padding: 0 20px;
  border-radius: 8px;
  white-space: nowrap;
}

.app-page .disclosure-button {
  min-height: var(--web-control-min-height);
  margin: 4px 0 0;
  font-size: 13px;
}

.app-page .alias-field {
  max-width: calc(100% - 196px);
  margin: 8px 0 0;
}

.app-page .form-status {
  min-height: 0;
  margin-top: 4px;
}

.app-page .result-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--brand-primary-soft);
}

.result-check {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-primary-strong);
  color: #fff;
  font-weight: 700;
}

.result-copy {
  min-width: 0;
}

.app-page .result-kicker {
  margin-bottom: 3px;
}

.app-page .result-panel h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-page .result-url {
  margin: 0;
  font-size: 16px;
}

.app-page .result-expiry {
  margin: 5px 0 0;
  color: var(--warning);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.app-page .result-actions {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
}

.app-page .result-actions .button {
  width: auto;
  min-height: var(--web-control-min-height);
  white-space: nowrap;
}

.app-page .qr-panel {
  grid-column: 1 / -1;
}

.guest-gate,
.guest-live {
  grid-column: 1 / -1;
}

.guest-gate {
  padding-top: 16px;
  border-top: 1px solid rgba(11, 116, 201, 0.2);
}

.guest-limit-note {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
}

.guest-limit-note span {
  color: var(--muted);
}

.guest-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.guest-actions .button,
.guest-live .button {
  min-height: var(--web-control-min-height);
  padding: 0 16px;
  border-radius: 8px;
}

.guest-benefits {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.guest-live {
  padding-top: 4px;
}

.guest-live .button {
  width: 100%;
}

.app-page .links-section {
  margin-top: 24px;
  padding: 0;
  overflow: hidden;
}

.app-page .section-heading-row {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.app-page .section-description {
  margin: 6px 0 0;
  font-size: 12px;
}

.app-page .links-status {
  min-height: 0;
  margin: 0;
  padding: 0 22px;
}

.links-table-head,
.app-page .link-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(130px, 0.9fr) 76px 96px 92px;
  gap: 12px;
  align-items: center;
}

.links-table-head {
  min-height: 40px;
  padding: 0 22px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
}

.app-page .links-list {
  border-top: 0;
}

.app-page .link-row {
  min-height: 76px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.app-page .link-row-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.app-page .link-row-main .link-row-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary-strong);
  font-size: 13px;
  margin-top: 0;
  font-weight: 700;
}

.link-row-copy {
  min-width: 0;
}

.app-page .link-row-main .link-row-copy > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.link-row-short,
.link-row-date {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-row-short {
  color: var(--ink);
  font-weight: 700;
}

.app-page .status-badge {
  justify-self: start;
  white-space: nowrap;
}

.app-page .link-row-actions {
  justify-content: flex-end;
}

.app-page .compact-button {
  min-width: var(--web-control-min-height);
  min-height: var(--web-control-min-height);
  padding: 0 10px;
  border-radius: 8px;
}

.app-page .compact-button:disabled {
  cursor: not-allowed;
}

.app-page .empty-state {
  margin: 16px 22px 22px;
  padding: 28px 20px;
  border-color: var(--line);
  border-radius: 8px;
}

.workspace-rail {
  display: grid;
  gap: 16px;
}

.app-page .account-note,
.app-page .extension-callout,
.browser-storage {
  border-radius: 12px;
}

.app-page .account-note,
.app-page .extension-callout {
  display: block;
  margin: 0;
  padding: 20px;
}

.app-page .account-note {
  border-color: rgba(51, 156, 255, 0.4);
}

.app-page .extension-callout {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.rail-icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-primary-strong);
  font-size: 13px;
}

.app-page .extension-callout .rail-icon {
  background: var(--brand-primary-soft);
}

.app-page .account-note h2,
.app-page .extension-callout h2 {
  margin-bottom: 8px;
  font-size: 16px;
}

.app-page .account-note p,
.app-page .extension-callout p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.app-page .text-button,
.app-page .text-link {
  display: inline-flex;
  min-height: var(--web-control-min-height);
  align-items: center;
  color: var(--link);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.browser-storage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.browser-storage strong {
  color: var(--ink);
}

.app-page .detail-view {
  margin-bottom: 72px;
}

@media (max-width: 980px) {
  .app-page .workspace-grid {
    grid-template-columns: 1fr;
  }

  .workspace-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browser-storage {
    grid-column: 1 / -1;
  }

  .links-table-head,
  .app-page .link-row {
    grid-template-columns: minmax(210px, 1.35fr) minmax(130px, 0.9fr) 76px 92px;
  }

  .link-row-date,
  .links-table-head span:nth-child(4) {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-page .app-header,
  .app-page .app-shell {
    width: min(100% - 28px, 1240px);
  }

  .app-page .app-header {
    min-height: 64px;
    flex-wrap: nowrap;
  }

  .app-page .app-header nav {
    display: none;
  }

  .app-page .brand-mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .app-page .account-button {
    padding: 0 12px;
    font-size: 12px;
  }

  .app-page .app-shell {
    padding-top: 32px;
  }

  .app-page .intro {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 24px;
  }

  .app-page .intro h1 {
    font-size: 28px;
  }

  .session-note {
    display: none;
  }

  .app-page .composer-panel {
    padding: 20px;
  }

  .composer-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .create-row {
    grid-template-columns: 1fr;
  }

  .app-page #submit-button {
    width: 100%;
    margin-top: 0;
  }

  .app-page .alias-field {
    max-width: none;
  }

  .app-page .result-panel {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .app-page .result-actions {
    grid-column: 1 / -1;
  }

  .app-page .result-actions .button {
    flex: 1;
  }

  .guest-actions {
    grid-template-columns: 1fr;
  }

  .links-table-head {
    display: none;
  }

  .app-page .link-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 76px;
    padding: 12px 16px;
  }

  .link-row-short,
  .link-row-date,
  .app-page .link-row > .status-badge {
    display: none;
  }

  .workspace-rail {
    grid-template-columns: 1fr;
  }

  .browser-storage {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .app-page .brand span {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-page .account-button {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-page .input-action-row {
    padding-right: 5px;
  }

  .app-page .paste-button {
    display: inline-flex;
    min-width: 68px;
    align-items: center;
    justify-content: center;
  }

  .app-page .result-actions {
    flex-direction: column;
  }
}

/* 0.3 workspace: task-first navigation with fewer competing surfaces. */
.app-page .app-header,
.app-page .app-shell {
  width: min(100% - 48px, 1040px);
}

.app-page .app-shell {
  padding-top: 48px;
}

.app-page .intro {
  align-items: center;
  margin-bottom: 34px;
}

.app-page .intro h1 {
  max-width: 680px;
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.18;
}

.workspace-tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.workspace-tabs button {
  position: relative;
  min-height: 48px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.workspace-tabs button[aria-selected="true"] {
  color: var(--ink);
}

.workspace-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--brand-primary-strong);
  content: "";
}

.workspace-tabs button:focus-visible,
.account-mode-tabs button:focus-visible {
  outline: 3px solid rgba(11, 116, 201, 0.22);
  outline-offset: 3px;
}

.app-page .workspace-grid {
  display: block;
}

.workspace-panel {
  min-width: 0;
}

.app-page .composer-panel {
  padding: 28px 0 8px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.composer-heading {
  margin-bottom: 22px;
}

.composer-heading h2,
.app-page .section-heading-row h2 {
  font-size: 22px;
}

.app-page .input-action-row {
  border-radius: 10px;
}

.app-page #submit-button {
  border-radius: 10px;
}

.app-page .result-panel {
  margin-top: 24px;
  border: 1px solid rgba(11, 116, 201, 0.22);
  border-radius: 10px;
  background: #f7fbff;
}

.app-page .links-section {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 56px;
  padding: 10px 0 32px;
}

.account-main {
  max-width: 520px;
}

.section-label {
  margin: 0 0 8px;
  color: var(--brand-primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-main > h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.account-main > p,
.account-side p,
.password-setup-form > p {
  color: var(--muted);
  line-height: 1.65;
}

.account-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 26px 0 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.account-mode-tabs button {
  min-height: var(--web-control-min-height);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.account-mode-tabs button[aria-selected="true"] {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(24, 33, 31, 0.12);
  color: var(--ink);
}

.account-main .field input {
  width: 100%;
  min-height: 50px;
}

.account-main #account-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  border-radius: 9px;
}

.account-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 12px;
}

.account-secondary-actions .text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.account-feedback {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--brand-primary-strong);
  background: #f4f8fb;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.account-feedback[data-kind="error"] {
  border-color: var(--danger);
  background: #fff7f6;
}

.password-setup-form {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.password-setup-form h3,
.account-side h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.account-side {
  display: grid;
  align-content: start;
  gap: 0;
  border-top: 1px solid var(--line);
}

.account-summary,
.account-side .extension-connection,
.account-side .extension-callout {
  padding: 24px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.account-side .browser-storage {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.account-side .text-link {
  min-height: var(--web-control-min-height);
}

@media (max-width: 720px) {
  .app-page .app-header,
  .app-page .app-shell {
    width: min(100% - 28px, 1040px);
  }

  .app-page .app-shell {
    padding-top: 32px;
  }

  .app-page .intro {
    margin-bottom: 22px;
  }

  .workspace-tabs {
    gap: 20px;
    overflow-x: auto;
  }

  .workspace-tabs button {
    flex: 0 0 auto;
  }

  .app-page .composer-panel {
    padding-top: 12px;
  }

  .account-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .account-secondary-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
