:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef8fc;
  color: #0d2552;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(58, 183, 232, 0.18), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(96, 210, 198, 0.18), transparent 30%),
    linear-gradient(180deg, #eefaff 0%, #f7fbfd 380px, #f6f9fb 100%);
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(143, 176, 195, 0.35);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(13, 37, 82, 0.03);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #17202a;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  display: block;
  width: 180px;
  height: 44px;
}

.brand span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.utility-nav {
  display: flex;
  gap: 16px;
  margin-left: auto;
  color: #49627d;
  font-size: 14px;
}

.toolbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: #0d2552;
  font-size: 14px;
  font-weight: 850;
}

.toolbar-nav > a,
.toolbar-nav > button,
.nav-dropdown > summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #122b5b;
  cursor: pointer;
  white-space: nowrap;
}

.toolbar-nav > a:hover,
.toolbar-nav > button:hover,
.nav-dropdown > summary:hover {
  background: #eef3f6;
}

.toolbar-nav > a.active {
  background: #e8f7fb;
  color: #0d2552;
  box-shadow: inset 0 -2px 0 #12a8c7;
}

.nav-dropdown {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.nav-dropdown > summary {
  list-style: none;
  gap: 8px;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.nav-dropdown[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.nav-dropdown > div {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 210px;
  padding: 8px;
  border: 1px solid #cfe3ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(13, 37, 82, 0.13);
}

.nav-dropdown a,
.nav-dropdown button {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #49627d;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.nav-dropdown a:hover,
.nav-dropdown button:hover {
  background: #eef3f6;
  color: #0d2552;
}

.tool-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 22px 36px;
}

.tool-hero.compact {
  padding-top: 34px;
}

.tool-hero.compact .intro {
  max-width: 860px;
  margin-bottom: 18px;
}

.tool-hero.compact h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.intro {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: #12a8c7;
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.summary {
  margin-bottom: 18px;
  color: #49627d;
  font-size: 17px;
  line-height: 1.7;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 34px 0 24px;
}

.category-tabs button {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid #c8e2ed;
  border-radius: 999px;
  background: #ffffff;
  color: #35536f;
  font-size: 15px;
  font-weight: 800;
}

.category-tabs button.active {
  border-color: #12a8c7;
  background: #12a8c7;
  color: #ffffff;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.tool-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 230px;
  width: 100%;
  padding: 22px;
  border: 1px solid #d7e7ef;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #0d2552;
  text-align: left;
  box-shadow: 0 16px 42px rgba(13, 37, 82, 0.07);
}

.tool-card:hover {
  border-color: #9bd7e8;
  background: #ffffff;
  transform: translateY(-1px);
}

.tool-card strong {
  font-size: 20px;
  line-height: 1.2;
}

.tool-card p {
  margin: 0;
  color: #60758b;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
}

.tool-status {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f4f7;
  color: #647386;
  font-size: 12px;
  font-weight: 800;
}

.tool-status.live-status {
  background: #e6f4ef;
  color: #287052;
}

.tool-action {
  align-self: end;
  width: max-content;
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #17202a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.tool-card.hidden {
  display: none;
}

.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.tool-icon.word {
  background: #4e79c7;
}

.tool-icon.md {
  background: #1f6f78;
}

.tool-icon.doc {
  background: #7d8b9c;
}

.tool-icon.csv {
  background: #4d9a63;
}

.tool-icon.html {
  background: #db7047;
}

.tool-icon.brief {
  background: #9a6ac8;
}

.tool-icon.sop {
  background: #c68a35;
}

.tool-icon.obsidian {
  background: #6f5bb8;
}

.converter {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}

.editor-card,
.result-card,
.content-section,
details {
  border: 1px solid #d8dee5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(23, 32, 42, 0.07);
}

.editor-card,
.result-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 620px;
  overflow: hidden;
}

.result-card {
  grid-template-rows: auto 1fr;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #d8dee5;
}

.card-header h2 {
  margin-bottom: 5px;
  font-size: 17px;
  line-height: 1.25;
}

.card-header p {
  margin: 0;
  color: #627080;
  font-size: 13px;
  line-height: 1.45;
}

button {
  min-height: 40px;
  border: 1px solid #aeb8c2;
  border-radius: 7px;
  background: #ffffff;
  color: #17202a;
  cursor: pointer;
  padding: 0 14px;
  white-space: nowrap;
}

button:hover {
  background: #eef3f6;
}

button.primary {
  border-color: #1f6f78;
  background: #1f6f78;
  color: #ffffff;
  font-weight: 800;
}

.title-field {
  display: grid;
  grid-template-columns: 94px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #d8dee5;
  color: #526173;
  font-size: 13px;
}

.title-field input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #c6d0da;
  border-radius: 7px;
  padding: 0 10px;
  color: #17202a;
}

.file-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 96px;
  margin: 14px 16px 0;
  padding: 18px;
  border: 1px dashed #8aa1b4;
  border-radius: 8px;
  background: #f5f9fb;
  text-align: center;
  color: #526173;
}

.file-dropzone strong,
.file-dropzone span {
  display: block;
}

.file-dropzone strong {
  margin-bottom: 5px;
  color: #17202a;
  font-size: 15px;
}

.file-dropzone span {
  font-size: 13px;
  line-height: 1.45;
}

.file-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-dropzone.dragging {
  border-color: #1f6f78;
  background: #e7f4f5;
}

textarea {
  width: 100%;
  height: 100%;
  min-height: 382px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 18px;
  color: #17202a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.62;
}

iframe {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: #ffffff;
}

.content-section {
  max-width: 1180px;
  margin: 18px auto;
  padding: 26px;
}

.section-copy {
  max-width: 760px;
}

.content-section h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.content-section p {
  color: #526173;
  line-height: 1.72;
}

.use-cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.use-cases article {
  padding: 16px;
  border: 1px solid #d8dee5;
  border-radius: 8px;
  background: #fbfcfd;
}

.use-cases h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.use-cases p {
  margin-bottom: 0;
  font-size: 14px;
}

.narrow {
  max-width: 860px;
}

details {
  margin-top: 10px;
  padding: 14px 16px;
  box-shadow: none;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 10px 0 0;
}

#status {
  position: fixed;
  left: 18px;
  bottom: 18px;
  max-width: min(560px, calc(100vw - 36px));
  padding: 0;
  border-radius: 7px;
  background: transparent;
  color: transparent;
  font-size: 13px;
}

#status.ok,
#status.error {
  padding: 10px 12px;
  background: #17202a;
  color: #ffffff;
}

#status.error {
  background: #8f2f2a;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .utility-nav {
    position: absolute;
    right: 22px;
    top: 22px;
    width: auto;
  }

  .converter,
  .use-cases,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 0;
  }

  .editor-card,
  .result-card {
    min-height: 0;
  }

  textarea,
  iframe {
    min-height: 460px;
  }
}

@media (max-width: 560px) {
  .tool-hero,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand img {
    width: 156px;
    height: auto;
  }

  .utility-nav {
    right: 14px;
    top: 21px;
  }

  .category-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

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

  .card-header {
    flex-direction: column;
  }

  .card-header button {
    width: 100%;
  }

  .title-field {
    grid-template-columns: 1fr;
  }

  .content-section {
    margin-left: 14px;
    margin-right: 14px;
    padding: 18px;
  }
}
