:root {
  --background: #050816;
  --surface: rgba(10, 15, 31, 0.86);
  --surface-strong: rgba(16, 24, 42, 0.96);
  --border: rgba(148, 163, 184, 0.2);
  --text: #f8fbff;
  --muted: rgba(214, 227, 255, 0.72);
  --blue: #38bdf8;
  --purple: #a78bfa;
  --orange: #fb923c;
  --danger: #fb7185;
  --green: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 12%, rgba(56, 189, 248, 0.13), transparent 30rem),
    radial-gradient(circle at 78% 4%, rgba(167, 139, 250, 0.11), transparent 28rem),
    #000;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.top-bar,
.admin-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: rgba(5, 8, 22, 0.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.3);
}

.brand {
  margin-right: auto;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  border-color: rgba(56, 189, 248, 0.42);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(167, 139, 250, 0.22));
}

.button.danger {
  border-color: rgba(251, 113, 133, 0.42);
  color: #fecdd3;
}

.login-shell,
.admin-shell,
.editor-shell,
.public-shell,
.post-shell {
  width: min(1120px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-panel,
.panel,
.preview,
.publish-actions,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.login-panel {
  display: grid;
  gap: 1rem;
  width: min(420px, 100%);
  padding: 1.5rem;
}

.toolbar,
.editor-head,
.public-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.75rem);
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted,
small {
  color: var(--muted);
}

.notice {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.notice.error {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fecdd3;
}

.notice.success {
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  outline: none;
}

input {
  min-height: 2.8rem;
  padding: 0 0.8rem;
}

textarea {
  min-height: 58vh;
  padding: 1rem;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.55;
}

select {
  min-height: 2.8rem;
  padding: 0 0.8rem;
}

.post-list {
  display: grid;
  gap: 1.5rem;
}

.library-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.library-controls label {
  min-width: 10.5rem;
}

.post-date-group {
  display: grid;
  gap: 0.6rem;
}

.post-date-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.15rem;
  color: var(--muted);
}

.post-date-heading h2 {
  font-size: 0.9rem;
}

.post-date-heading span {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.72rem;
}

.post-date-items {
  display: grid;
  gap: 0.45rem;
}

.post-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 15, 31, 0.68);
  text-decoration: none;
}

.post-row strong,
.post-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  min-width: 3.2rem;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.status.live {
  background: rgba(52, 211, 153, 0.18);
  color: #a7f3d0;
}

.status.draft {
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
}

.row-meta {
  display: grid;
  gap: 0.25rem;
  justify-items: end;
  color: var(--muted);
  font-size: 0.85rem;
}

.row-meta b {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
}

.empty-state {
  padding: 2rem;
}

.settings-shell {
  width: min(680px, calc(100vw - 2rem));
}

.settings-form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.settings-form h2 {
  margin-bottom: 0.4rem;
}

.settings-form .button {
  justify-self: start;
}

.settings-form label > small {
  margin-top: -0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.password-visibility {
  align-items: center;
  min-height: 2.75rem;
  width: fit-content;
  cursor: pointer;
}

.rich-editor-shell {
  width: min(1520px, calc(100vw - 2rem));
}

.site-editor {
  display: grid;
  gap: 1rem;
}

.editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  align-items: start;
  gap: 1rem;
}

.content-stack {
  display: grid;
  gap: 0.7rem;
}

.content-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 15, 31, 0.68);
}

.content-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.4rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 800;
}

.content-group summary small {
  font-size: 0.76rem;
}

.content-group-body {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.image-editor-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.image-editor-row > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #080b15;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.live-preview {
  position: sticky;
  top: 5.25rem;
  overflow: hidden;
  height: calc(100vh - 6.5rem);
  min-height: 40rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.live-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-strong);
}

.live-preview-bar strong {
  font-size: 0.85rem;
}

.live-preview-bar span {
  font-size: 0.75rem;
}

.live-preview iframe {
  display: block;
  width: 100%;
  height: calc(100% - 3rem);
  border: 0;
  background: #fff;
}

.editor-section {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.editor-section h2 {
  font-size: 1.2rem;
}

.two-column-fields,
.image-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.field-stack {
  display: grid;
  gap: 0.85rem;
}

.short-textarea {
  min-height: 5.5rem;
  font-family: inherit;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-field input {
  width: 1.1rem;
  min-height: 1.1rem;
}

.media-upload form,
.source-editor form,
.delete-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.media-upload input[type="file"] {
  padding: 0.55rem;
}

.source-editor {
  margin-top: 1rem;
  padding: 1.25rem;
}

.source-editor summary {
  cursor: pointer;
  font-weight: 800;
}

.source-editor form {
  display: grid;
  align-items: stretch;
  margin-top: 1rem;
}

.source-editor textarea {
  min-height: 34rem;
}

.delete-form {
  margin-top: 1rem;
}

@media (max-width: 680px) {
  .two-column-fields,
  .image-field {
    grid-template-columns: 1fr;
  }

  .media-upload form {
    align-items: stretch;
    flex-direction: column;
  }

  .library-controls label {
    min-width: min(100%, 13rem);
  }

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

/* Markdown writing workspace */
.post-editor-shell {
  width: min(1540px, calc(100vw - 2rem));
}

.post-details {
  display: grid;
  grid-template-columns: minmax(16rem, 1.35fr) minmax(13rem, 0.8fr) minmax(18rem, 1fr);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
}

.post-compact-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.post-compact-meta dt,
.pane-label,
.workspace-head a {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.post-compact-meta dd {
  overflow: hidden;
  margin: 0.2rem 0 0;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-workspace {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.82);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.32);
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.workspace-head h2 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.workspace-head a {
  display: block;
  overflow: hidden;
  max-width: min(64vw, 48rem);
  color: var(--blue);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tabs {
  display: none;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
}

.workspace-tabs button {
  min-height: 2rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.workspace-tabs button.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.writing-split {
  display: grid;
  grid-template-columns: minmax(500px, 1fr) minmax(500px, 0.9fr);
  min-height: clamp(640px, 72vh, 900px);
}

.writing-pane,
.render-pane {
  min-width: 0;
  background: #090d18;
}

.writing-pane {
  border-right: 1px solid var(--border);
}

.render-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #060a14;
}

.pane-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.35rem;
  padding: 0 0.85rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  text-transform: uppercase;
}

.pane-label span:last-child {
  color: rgba(214, 227, 255, 0.5);
  font-size: 0.68rem;
}

#post-preview {
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: 0;
  background: #050816;
}

#post-editor .toastui-editor-defaultUI {
  border: 0;
  border-radius: 0;
  background: #090d18;
}

#post-editor .toastui-editor-defaultUI-toolbar {
  min-height: 3.2rem;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #101624 !important;
}

#post-editor .toastui-editor-md-tab-container,
#post-editor .toastui-editor-mode-switch,
#post-editor .toastui-editor-tabs {
  display: none !important;
}

#post-editor .toastui-editor-main,
#post-editor .toastui-editor-md-container,
#post-editor .toastui-editor-md-container .toastui-editor {
  background: #090d18;
}

#post-editor .toastui-editor-md-container {
  width: 100%;
}

#post-editor .toastui-editor-md-preview {
  display: none;
}

#post-editor .toastui-editor-md-container .toastui-editor {
  padding: 1.4rem 1.65rem 4rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 16px;
  line-height: 1.75;
}

#post-editor .toastui-editor-main-container,
#post-editor .ProseMirror {
  background: #090d18 !important;
  color: #dbe7f5 !important;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 16px;
  line-height: 1.75;
}

#post-editor .ProseMirror .toastui-editor-md-heading,
#post-editor .ProseMirror .toastui-editor-md-strong,
#post-editor .ProseMirror .toastui-editor-md-marked-text {
  color: #f8fbff;
}

#post-editor .toastui-editor-md-delimiter,
#post-editor .toastui-editor-md-thematic-break,
#post-editor .toastui-editor-md-link,
#post-editor .toastui-editor-md-table,
#post-editor .toastui-editor-md-block-quote {
  color: #8fb7e8 !important;
}

#post-editor .toastui-editor-md-link-url,
#post-editor .toastui-editor-md-meta {
  color: #93c5fd !important;
}

#post-editor .toastui-editor-md-list-item-style {
  color: #fbbf6a !important;
}

#post-editor .toastui-editor-md-code,
#post-editor .toastui-editor-md-code-block {
  color: #f0abfc !important;
}

#post-editor .toastui-editor-md-code-block-line-background {
  background: #111827 !important;
}

#post-editor .toastui-editor-toolbar-divider {
  background: rgba(148, 163, 184, 0.24);
}

.post-preview-document {
  min-height: 100%;
  background: #050816;
}

.post-preview-page {
  width: min(760px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 3rem 0 8rem;
}

.post-preview-page .published-body {
  font-size: 16px;
}

@media (max-width: 1120px) {
  .post-details {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr);
  }

  .post-compact-meta {
    grid-column: 1 / -1;
  }

  .writing-split {
    grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  }
}

@media (max-width: 900px) {
  .post-details {
    grid-template-columns: 1fr;
  }

  .post-compact-meta {
    grid-column: auto;
  }

  .workspace-tabs {
    display: flex;
  }

  .writing-split {
    display: block;
    min-height: 0;
  }

  .writing-pane {
    border-right: 0;
  }

  .post-workspace[data-mobile-view="source"] .render-pane,
  .post-workspace[data-mobile-view="preview"] .writing-pane {
    display: none;
  }

  #post-editor,
  #post-preview {
    min-height: 68vh;
  }
}

@media (max-width: 560px) {
  .post-editor-shell {
    width: calc(100vw - 1.25rem);
  }

  .editor-head .actions {
    width: 100%;
  }

  .editor-head .actions .button {
    flex: 1;
  }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .workspace-tabs {
    width: 100%;
  }

  .workspace-tabs button {
    flex: 1;
  }

  .post-preview-page {
    width: calc(100% - 2rem);
    padding-top: 2rem;
  }
}

.editor-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.fields {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

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

.rich-markdown-panel {
  display: grid;
  gap: 0.45rem;
}

.editor-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.editor-label-row label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.editor-label-row span {
  font-size: 0.78rem;
}

#markdown-source {
  display: none;
}

#post-editor .toastui-editor-defaultUI {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
}

#post-editor .toastui-editor-toolbar,
#post-editor .toastui-editor-md-tab-container,
#post-editor .toastui-editor-mode-switch {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

#post-editor .toastui-editor-toolbar-icons {
  opacity: 0.82;
}

.actions,
.publish-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.publish-actions {
  justify-content: flex-end;
  margin: 1rem 0;
  padding: 0.85rem;
}

.meta-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.meta-list div {
  min-width: 0;
}

.meta-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-list dd {
  overflow-wrap: anywhere;
  margin: 0.2rem 0 0;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.import-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.preview {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.preview h2 {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 1rem;
}

.post-shell {
  width: min(880px, calc(100vw - 2rem));
}

.published-body {
  color: rgba(248, 251, 255, 0.94);
  line-height: 1.75;
}

.published-body h1 {
  margin: 0 0 1.4rem;
  color: var(--text);
}

.published-body h2,
.published-body h3,
.published-body h4,
.published-body h5,
.published-body h6 {
  margin: 2rem 0 0.75rem;
}

.published-body h2 {
  color: #c4b5fd;
}

.published-body h3 {
  color: #fdba74;
}

.published-body p,
.published-body ul,
.published-body ol,
.published-body blockquote,
.published-body table,
.published-body pre {
  margin: 0 0 1.1rem;
}

.published-body a {
  color: var(--blue);
}

.published-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.published-body table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
}

.published-body th,
.published-body td {
  padding: 0.65rem;
  border: 1px solid var(--border);
}

.published-body blockquote {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--blue);
  background: rgba(56, 189, 248, 0.08);
}

.published-body pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .editor-grid,
  .post-row,
  .editor-workspace {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .editor-head,
  .public-head {
    align-items: start;
    flex-direction: column;
  }

  .row-meta {
    display: none;
  }

  .live-preview {
    position: static;
    height: 68vh;
    min-height: 26rem;
  }
}

/* Content Studio uses the same frame, type, and surface language as davier.co. */
:root {
  --surface: rgba(8, 12, 26, 0.66);
  --surface-strong: rgba(12, 18, 34, 0.86);
  --border: rgba(148, 163, 184, 0.18);
  --blue: #60a5fa;
}

body {
  background:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.18), transparent 26%),
    radial-gradient(circle at 18% 20%, rgba(139, 92, 246, 0.16), transparent 22%),
    linear-gradient(180deg, rgba(4, 8, 20, 0.98), rgba(5, 8, 22, 1) 52%, rgba(10, 14, 28, 1) 100%);
  font-family: "Inter", "Avenir Next", "SF Pro Display", "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
}

.admin-bar {
  top: 1rem;
  width: min(calc(100% - 2rem), 1360px);
  min-height: 4.5rem;
  margin: 1rem auto 0;
  padding: 0.55rem 0.7rem 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(30px) saturate(1.2);
}

.studio-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  color: var(--text);
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.studio-brand img {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  object-fit: cover;
}

.studio-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.studio-nav-links a,
.quiet-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.45rem;
  padding: 0 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.studio-nav-links a:hover,
.studio-nav-links a.is-active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.quiet-button {
  border-color: transparent;
  background: transparent;
  cursor: pointer;
}

.button,
.icon-button {
  border-radius: 999px;
}

.button.primary {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(96, 165, 250, 0.2);
}

.admin-shell {
  width: min(1360px, calc(100vw - 2rem));
  padding-top: 2.25rem;
}

.editor-shell,
.settings-shell {
  width: min(1120px, calc(100vw - 2rem));
}

.settings-shell {
  width: min(680px, calc(100vw - 2rem));
}

.login-panel,
.panel,
.preview,
.publish-actions,
.empty-state {
  background: var(--surface);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.studio-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 2.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.studio-overview a {
  display: grid;
  gap: 0.25rem;
  min-height: 7.5rem;
  padding: 1.25rem;
  border-right: 1px solid var(--border);
  text-decoration: none;
}

.studio-overview a:last-child {
  border-right: 0;
}

.studio-overview span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.studio-overview strong {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.35rem;
}

.studio-overview a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.studio-home-shell {
  width: min(1120px, calc(100vw - 2rem));
}

.studio-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.studio-entry {
  display: grid;
  gap: 0.55rem;
  min-height: 17rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
}

.studio-entry strong {
  margin-top: auto;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 3.75rem;
  line-height: 1;
}

.studio-entry > span {
  color: var(--muted);
  font-size: 0.92rem;
}

.studio-entry:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(17, 25, 45, 0.7);
  transform: translateY(-2px);
}

.studio-collection {
  margin: 0 0 3rem;
  scroll-margin-top: 7rem;
}

.collection-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.collection-head h2 {
  font-size: 1.55rem;
}

.site-page-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.site-page-row {
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr) minmax(10rem, 0.8fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.site-page-row:hover,
.post-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.site-page-path {
  color: var(--blue);
  font-size: 0.86rem;
}

@media (max-width: 960px) {
  .admin-bar {
    width: min(calc(100% - 1.25rem), 1360px);
    flex-wrap: wrap;
    border-radius: 18px;
  }

  .studio-nav-links {
    order: 3;
    display: grid;
    grid-template-columns: repeat(6, max-content);
    flex: 1 0 100%;
    width: 100%;
    overflow-x: auto;
    padding-top: 0.15rem;
    scrollbar-width: none;
  }

  .studio-nav-links::-webkit-scrollbar {
    display: none;
  }

  .studio-overview {
    grid-template-columns: 1fr;
  }

  .studio-home-grid {
    grid-template-columns: 1fr;
  }

  .studio-overview a {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .studio-overview a:last-child {
    border-bottom: 0;
  }
}

/* First-party analytics */
.analytics-shell {
  padding-bottom: 6rem;
}

.analytics-head {
  align-items: center;
}

.range-tabs {
  display: flex;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.range-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0 0.85rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.range-tabs a.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.28);
}

.analytics-metrics article {
  display: grid;
  min-width: 0;
  padding: 1.25rem 1.4rem;
  border-right: 1px solid var(--border);
}

.analytics-metrics article:last-child {
  border-right: 0;
}

.analytics-metrics span,
.analytics-metrics small,
.analytics-panel-head p,
.analytics-row small {
  color: var(--muted);
}

.analytics-metrics span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.analytics-metrics strong {
  margin: 0.15rem 0 0.25rem;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 2.6rem;
  line-height: 1;
}

.analytics-metrics small {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.24);
}

.analytics-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.4rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.analytics-panel-head h2 {
  font-size: 1.05rem;
}

.analytics-panel-head p {
  margin: 0.22rem 0 0;
  font-size: 0.78rem;
}

.chart-key {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.chart-key span {
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.35rem;
  border-radius: 2px;
}

.views-key {
  background: #60a5fa;
}

.visitors-key {
  background: #f59e0b;
}

.traffic-panel {
  margin-bottom: 1rem;
}

.traffic-chart-scroll {
  overflow-x: auto;
  padding: 1.25rem 1rem 0.85rem;
}

.traffic-chart {
  display: grid;
  grid-template-columns: repeat(var(--day-count), minmax(22px, 1fr));
  gap: 0.3rem;
  min-width: calc(var(--day-count) * 22px);
  height: 18rem;
}

.traffic-day {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 2rem;
  min-width: 0;
}

.traffic-bars {
  position: relative;
  min-height: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(25% - 1px),
    rgba(148, 163, 184, 0.08) 25%
  );
}

.traffic-bars i {
  position: absolute;
  bottom: 0;
  min-height: 0;
  border-radius: 3px 3px 0 0;
}

.view-bar {
  right: 14%;
  width: 44%;
  background: #60a5fa;
}

.visitor-bar {
  left: 14%;
  width: 28%;
  background: #f59e0b;
}

.traffic-day time {
  overflow: hidden;
  padding-top: 0.55rem;
  color: rgba(214, 227, 255, 0.58);
  font-size: 0.63rem;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.analytics-side {
  display: grid;
  gap: 1rem;
}

.analytics-table {
  display: grid;
}

.analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 4.2rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.analytics-row:last-child {
  border-bottom: 0;
}

.analytics-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.analytics-row > span {
  display: grid;
  min-width: 0;
}

.analytics-row > span:last-child {
  text-align: right;
}

.analytics-row b {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-row small {
  font-size: 0.72rem;
}

.breakdown-list {
  display: grid;
  padding: 0.8rem 1rem 1rem;
}

.breakdown-list > div:not(.analytics-empty) {
  display: grid;
  grid-template-columns: minmax(5rem, 0.7fr) minmax(5rem, 1fr) 2.5rem;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.2rem;
  font-size: 0.78rem;
}

.breakdown-list span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-list i {
  overflow: hidden;
  height: 0.42rem;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.12);
}

.breakdown-list i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #34d399;
}

.breakdown-list strong {
  text-align: right;
}

.analytics-empty {
  padding: 1.5rem 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 960px) {
  .studio-home-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .analytics-head {
    align-items: stretch;
  }

  .range-tabs a {
    flex: 1;
    justify-content: center;
  }

  .analytics-metrics {
    grid-template-columns: 1fr;
  }

  .analytics-metrics article {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .analytics-metrics article:last-child {
    border-bottom: 0;
  }

  .analytics-metrics strong {
    font-size: 2.15rem;
  }

  .traffic-chart {
    height: 15rem;
  }
}

/* Content dashboard */
.dashboard-shell {
  padding-bottom: 6rem;
}

.dashboard-head {
  align-items: center;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-metrics a {
  display: grid;
  min-width: 0;
  min-height: 9rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.dashboard-metrics a:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(17, 25, 45, 0.72);
}

.dashboard-metrics span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-metrics strong {
  align-self: end;
  margin-top: 0.7rem;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 2.65rem;
  line-height: 1;
}

.dashboard-metrics small {
  overflow: hidden;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.dashboard-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.24);
}

.dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.4rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-panel-head h2 {
  font-size: 1.05rem;
}

.dashboard-panel-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.dashboard-panel-head > a {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
}

.dashboard-list {
  display: grid;
}

.dashboard-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 4.15rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.dashboard-row:last-child {
  border-bottom: 0;
}

.dashboard-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.dashboard-row-main,
.dashboard-row-value {
  display: grid;
  min-width: 0;
}

.dashboard-row-main b {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-row small,
.dashboard-row time {
  color: var(--muted);
  font-size: 0.7rem;
}

.dashboard-row time {
  white-space: nowrap;
}

.dashboard-traffic-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dashboard-row-value {
  text-align: right;
}

.dashboard-row-value b {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1rem;
}

.dashboard-empty {
  padding: 2rem 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .dashboard-head {
    align-items: stretch;
  }

  .dashboard-head .actions,
  .dashboard-head .button {
    width: 100%;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics a {
    min-height: 7.8rem;
  }

  .dashboard-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dashboard-row time {
    display: none;
  }

  .dashboard-traffic-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 680px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .admin-bar {
    padding: 0.65rem;
  }

  .studio-nav-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    gap: 0.35rem;
  }

  .studio-nav-links a,
  .quiet-button {
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 0.45rem;
  }

  .admin-shell,
  .editor-shell,
  .settings-shell {
    width: min(calc(100% - 1.25rem), 1360px);
  }

  .settings-form {
    gap: 1.05rem;
    padding: 1rem;
  }

  .settings-form .button {
    justify-self: stretch;
    min-height: 2.75rem;
    width: 100%;
  }

  .settings-form .notice {
    overflow-wrap: anywhere;
  }

  .site-page-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .site-page-path,
  .site-page-row .row-meta {
    grid-column: 2;
  }
}
