* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: #0b1020;
  color: #f8fafc;
}

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

button {
  border: 0;
  cursor: pointer;
}

.edu-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  background: #0b1220;
  border-right: 1px solid #223047;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #22c55e;
  color: #07110b;
  font-weight: 900;
  font-size: 24px;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p,
.eyebrow,
.message {
  color: #94a3b8;
}

.tool-nav,
.nav-section {
  display: grid;
  gap: 8px;
}

.tool-nav {
  gap: 18px;
}

.nav-section-label {
  margin: 0 0 2px;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-tab,
.ghost-button {
  min-height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cbd5e1;
  background: transparent;
  padding: 0 12px;
  text-align: left;
}

.tool-tab:hover,
.ghost-button:hover {
  background: #1f2937;
}

.tool-tab.active {
  background: #2563eb;
  color: #f8fafc;
}

.sidebar-links {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.sidebar-links a {
  color: #93c5fd;
  font-weight: 800;
  text-decoration: none;
}

.main-panel {
  min-width: 0;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(37, 99, 235, 0.16), transparent 32%),
    #07130d;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: 32px;
}

.account-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.plan-pill,
.usage-pill,
.account-pill {
  min-height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #263449;
  background: #0b1220;
  color: #dbeafe;
  font-weight: 800;
}

.plan-pill {
  border-color: #22c55e;
  color: #bbf7d0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
}

.input-panel,
.output-panel {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #263449;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.premium-notice {
  border: 1px solid #a16207;
  background: rgba(113, 63, 18, 0.32);
  color: #bbf7d0;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.45;
  font-weight: 700;
}

label {
  display: block;
  margin: 14px 0 8px;
  color: #dbeafe;
  font-weight: 800;
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #08111f;
  color: white;
  padding: 12px 14px;
  outline: none;
}

textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.5;
}

.short-textarea {
  min-height: 110px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #60a5fa;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.icon-button,
.text-button {
  min-height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}

.primary-button {
  background: #22c55e;
  color: #07110b;
  font-weight: 900;
}

.secondary-button {
  background: #1f2937;
  color: #e5e7eb;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.output-header,
.recent-header {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.output-header h3,
.recent-header h4 {
  margin: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  color: #cbd5e1;
  background: #0b1220;
  border: 1px solid #263449;
}

.text-button {
  min-height: 30px;
  background: transparent;
  color: #93c5fd;
  padding: 0 8px;
  font-weight: 800;
}

pre {
  min-height: 420px;
  max-height: 62vh;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.55;
  color: #e5e7eb;
  background: #08111f;
  border: 1px solid #263449;
  border-radius: 8px;
  padding: 16px;
}

.recent-results {
  margin-top: 18px;
  border-top: 1px solid #223047;
  padding-top: 16px;
}

.recent-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.recent-empty {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.recent-item {
  width: 100%;
  border: 1px solid #263449;
  border-radius: 8px;
  background: #0b1220;
  color: #e5e7eb;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
}

.recent-item:hover {
  border-color: #60a5fa;
}

.recent-item-title,
.recent-item-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item-title {
  font-weight: 900;
}

.recent-item-meta {
  color: #94a3b8;
  font-size: 12px;
}

svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 980px) {
  .edu-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #223047;
  }

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

  .main-panel {
    padding: 20px;
  }

  .topbar {
    flex-direction: column;
  }
}


/* Parent Power Tools */
.nav-section:nth-of-type(2) .nav-section-label {
  color: #bbf7d0;
}

.nav-section:nth-of-type(2) .tool-tab.active {
  background: #1d4ed8;
}


/* Student Profiles and Progress */
.student-profile-panel,
.progress-tracker {
  margin: 16px 0 18px;
  border: 1px solid #263449;
  border-radius: 8px;
  background: #0b1220;
  padding: 14px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.profile-header h3,
.profile-header p {
  margin: 0;
}

.profile-header h3 {
  font-size: 16px;
}

.profile-header p {
  margin-top: 4px;
  color: #94a3b8;
  line-height: 1.4;
  font-size: 13px;
}

.profile-form {
  margin-top: 12px;
  border-top: 1px solid #223047;
  padding-top: 12px;
}

.mini-textarea {
  min-height: 72px;
}

.progress-item {
  border: 1px solid #263449;
  border-radius: 8px;
  background: #08111f;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
}

.progress-item strong,
.progress-item span,
.progress-item p {
  min-width: 0;
}

.progress-item strong {
  color: #e5e7eb;
}

.progress-item span {
  color: #94a3b8;
  font-size: 12px;
}

.progress-item p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.45;
  font-size: 13px;
}


/* Premium responsive polish */
html {
  scroll-behavior: smooth;
}

.edu-shell {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 #101827;
}

.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-track {
  background: #101827;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 999px;
  border: 2px solid #101827;
}

.brand {
  min-width: 0;
}

.brand h1,
.brand p,
.tool-tab span,
.sidebar-links a {
  overflow-wrap: anywhere;
}

.tool-tab {
  position: relative;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.tool-tab:hover {
  transform: translateX(2px);
}

.tool-tab.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: #22c55e;
}

.main-panel {
  min-height: 100vh;
}

.topbar {
  align-items: center;
}

.topbar h2 {
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.account-group {
  max-width: 760px;
}

.plan-pill,
.usage-pill,
.account-pill {
  white-space: nowrap;
}

.workspace {
  align-items: start;
}

.output-panel {
  position: sticky;
  top: 24px;
}

.education-overview {
  border: 1px solid #263449;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.14), transparent 42%),
    #0b1220;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.overview-kicker,
.education-overview h3 {
  margin: 0;
}

.overview-kicker {
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.education-overview h3 {
  margin-top: 5px;
  color: #f8fafc;
  font-size: 19px;
  line-height: 1.25;
}

.overview-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.overview-steps span {
  min-height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.36);
  font-size: 12px;
  font-weight: 900;
}

.premium-notice,
.student-profile-panel,
.progress-tracker,
.recent-results,
.input-panel,
.output-panel {
  overflow: hidden;
}

.profile-header,
.recent-header,
.output-header {
  min-width: 0;
}

.profile-header > div,
.topbar > div:first-child {
  min-width: 0;
}

.profile-header h3,
.profile-header p,
.recent-header h4 {
  overflow-wrap: anywhere;
}

input,
textarea,
select,
pre {
  min-width: 0;
}

.primary-button,
.secondary-button {
  flex: 0 1 auto;
}

.actions .primary-button {
  min-width: 150px;
}

.actions .secondary-button {
  min-width: 108px;
}

@media (max-width: 1180px) {
  .edu-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .main-panel {
    padding: 24px;
  }

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

  .output-panel {
    position: static;
  }

  pre {
    min-height: 320px;
    max-height: none;
  }
}

@media (max-width: 980px) {
  .edu-shell {
    display: block;
  }

  .sidebar {
    position: static;
    max-height: none;
    padding: 18px;
  }

  .tool-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .nav-section {
    min-width: 0;
  }

  .tool-tab {
    min-height: 42px;
    padding: 0 10px;
  }

  .tool-tab:hover {
    transform: none;
  }

  .sidebar-links {
    margin-top: 14px;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .topbar {
    align-items: stretch;
  }

  .account-group {
    justify-content: flex-start;
  }

  .education-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-steps {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .main-panel {
    padding: 16px;
  }

  .sidebar {
    padding: 16px;
  }

  .tool-nav {
    grid-template-columns: 1fr;
  }

  .nav-section {
    border-top: 1px solid #223047;
    padding-top: 12px;
  }

  .nav-section:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .topbar h2 {
    font-size: 27px;
  }

  .account-group {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .plan-pill,
  .usage-pill,
  .account-pill {
    width: 100%;
    min-height: 38px;
    justify-content: flex-start;
    white-space: normal;
    line-height: 1.3;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .input-panel,
  .output-panel {
    padding: 16px;
  }

  .education-overview h3 {
    font-size: 17px;
  }

  .profile-header,
  .recent-header,
  .output-header {
    align-items: flex-start;
  }

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

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  textarea {
    min-height: 210px;
  }

  .short-textarea {
    min-height: 96px;
  }

  .mini-textarea {
    min-height: 70px;
  }

  pre {
    min-height: 260px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p,
  .premium-notice,
  .profile-header p,
  .progress-item p {
    font-size: 13px;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .overview-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .overview-steps span {
    justify-content: center;
    padding: 0 8px;
  }
}


/* Mobile overflow guardrails */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.edu-shell,
.sidebar,
.main-panel,
.workspace,
.input-panel,
.output-panel,
.topbar,
.account-group,
.education-overview,
.student-profile-panel,
.progress-tracker {
  min-width: 0;
  max-width: 100%;
}

.tool-tab,
.ghost-button,
.plan-pill,
.usage-pill,
.account-pill,
.primary-button,
.secondary-button,
.text-button {
  max-width: 100%;
}

.topbar h2,
.education-overview h3,
.profile-header h3,
.nav-section-label,
.tool-tab span {
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 760px) {
  .topbar h2 {
    max-width: calc(100vw - 32px);
    white-space: normal;
  }

  .tool-tab,
  .ghost-button {
    width: 100%;
  }

  .sidebar-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .main-panel,
  .sidebar {
    width: 100%;
  }

  .topbar h2 {
    font-size: 23px;
  }

  .premium-notice,
  .student-profile-panel,
  .progress-tracker,
  .recent-results,
  .education-overview {
    padding-left: 12px;
    padding-right: 12px;
  }
}


/* Mobile title wrapping refinement */
@media (max-width: 520px) {
  .topbar > div:first-child {
    width: 100%;
  }

  .topbar h2 {
    max-width: min(320px, calc(100vw - 48px));
    line-height: 1.12;
  }
}


/* Education billing controls */
.billing-button {
  min-height: 40px;
  border-radius: 999px;
  border: 0;
  padding: 0 16px;
  background: #22c55e;
  color: #052e16;
  font-weight: 900;
  white-space: nowrap;
}

.billing-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 760px) {
  .billing-button {
    width: 100%;
    min-height: 42px;
  }
}


/* Legal and trust footer */
.app-footer {
  border-top: 1px solid #223047;
  margin-top: 22px;
  padding: 18px 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #94a3b8;
}

.app-footer span {
  color: #f8fafc;
  font-weight: 900;
}

.app-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 14px;
}

.app-footer a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}

.app-footer a:hover {
  color: #86efac;
}

@media (max-width: 760px) {
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer nav {
    justify-content: flex-start;
  }
}


/* Account saved work */
.output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-work {
  margin-top: 18px;
  border-top: 1px solid #223047;
  padding-top: 16px;
}

.saved-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.saved-item-open {
  width: 100%;
  border: 1px solid #263449;
  border-radius: 8px;
  background: #0b1220;
  color: #e5e7eb;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
}

.saved-item-open:hover {
  border-color: #22c55e;
  background: #101827;
}

.saved-delete {
  border-radius: 8px;
  background: #3f1d1d;
  color: #fecaca;
  padding: 0 10px;
  font-weight: 800;
}

@media (max-width: 520px) {
  .saved-item {
    grid-template-columns: 1fr;
  }

  .saved-delete {
    min-height: 34px;
  }
}


/* Collapsed student profile summary */
.active-profile-summary {
  margin: -2px 0 10px;
  border: 1px solid #263449;
  border-radius: 8px;
  background: #08111f;
  color: #cbd5e1;
  padding: 10px 12px;
  line-height: 1.4;
  font-size: 14px;
}


/* Utility visibility */
.hidden,
.profile-form.hidden {
  display: none !important;
}


/* Getting started onboarding */
.onboarding-panel {
  border: 1px solid #263449;
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.78);
  padding: 16px;
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}

.onboarding-panel h3,
.onboarding-panel p {
  margin: 0;
}

.onboarding-panel h3 {
  font-size: 19px;
}

.onboarding-panel ol {
  margin: 0;
  padding-left: 20px;
  color: #cbd5e1;
  line-height: 1.7;
}

.onboarding-panel .text-button {
  justify-self: start;
}


/* Product access summary */
.product-access-panel {
  border: 1px solid #263449;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  padding: 16px;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-access-panel h3,
.product-access-panel p {
  margin: 0;
}

.product-access-panel h3 {
  margin-top: 4px;
  font-size: 20px;
}

.product-access-panel p:not(.overview-kicker) {
  margin-top: 5px;
  color: #cbd5e1;
  line-height: 1.45;
}

.access-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.access-actions a {
  min-height: 36px;
  border-radius: 8px;
  background: #1f2937;
  color: #dbeafe;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 760px) {
  .product-access-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .access-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
