/* ===========================================================================
   sqfty framework  —  replaces Foundation 5.5.3 (2015)
   ---------------------------------------------------------------------------
   Implements the same class contract the templates already use (.row,
   .columns, .large-6, .top-bar, .button …) so no markup had to change.
   Colours and metrics are taken from the previously compiled app.css so the
   rendering matches; they are not re-derived by eye.

   Plain CSS on purpose: no build step, so what is edited here is what ships.
   Valid CSS is valid SCSS, so this can be renamed .scss later if it ever
   needs mixins or loops.
   =========================================================================== */

:root {
  --primary:   #2082ff;
  --secondary: #bfbfbf;
  --success:   #04a63b;
  --alert:     #a60a27;
  --warning:   #ffa20b;
  --tertiary:  #0a4ea6;

  --body-bg:   #eee;
  --body-fg:   #222;
  --panel-bg:  #f2f2f2;
  --panel-br:  #d8d8d8;
  --table-head:#333;

  --radius:    5px;
  --row-width: 960px;
  --topbar-h:  2.5625rem;

  --font-body:   "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-header: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* --- base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; height: 100%; }  /* height: app-custom.css pins the footer via #wrapper{min-height:100%} */

body {
  margin: 0;
  background: var(--body-bg);
  color: var(--body-fg);
  font-family: var(--font-body);
  font-size: 1rem;
  /* 1.5, not 1.25. The 1.25 in _settings.scss is $paragraph-line-height and
     applies to <p>; the body value is 1.5. Getting this wrong shifted every
     line of text on every page. */
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  font-weight: 400;
  color: #222;
  margin: 0 0 .5rem;
  line-height: 1.4;
}
h1 { font-size: 2.125rem; } h2 { font-size: 1.6875rem; } h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; } h5 { font-size: 1.125rem; } h6 { font-size: 1rem; }

/* Foundation scales headings up past the medium breakpoint. Omitting this made
   every heading render a step too small on normal desktop widths. */
@media (min-width: 40.0625em) {
  h1 { font-size: 2.75rem; }   h2 { font-size: 2.3125rem; }
  h3 { font-size: 1.6875rem; } h4 { font-size: 1.4375rem; }
  h5 { font-size: 1.125rem; }  h6 { font-size: 1rem; }
}

p { margin: 0 0 .625rem; line-height: 1.25; }

a { color: var(--primary); text-decoration: none; }
a:hover, a:focus { color: var(--tertiary); }

hr { border: 0; border-top: 1px solid var(--panel-br); margin: .25rem 0; }

img { max-width: 100%; height: auto; }

/* --- grid ---------------------------------------------------------------- */
/* Foundation's float grid, reimplemented with CSS Grid. Same class names,
   same 12 columns, but no clearfix hacks and no source-order constraints. */
.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 1.875rem;
  width: 100%;
  max-width: var(--row-width);
  margin: 0 auto;
}
.row .row { max-width: none; margin-left: -.9375rem; margin-right: -.9375rem; }

.columns, .column { grid-column-end: span 12; min-width: 0; }

/* Small screens first: every column is full width until a breakpoint says
   otherwise. Foundation's small-* applies at all widths. */
.small-1{grid-column-end:span 1}    .small-2{grid-column-end:span 2}
.small-3{grid-column-end:span 3}    .small-4{grid-column-end:span 4}
.small-5{grid-column-end:span 5}    .small-6{grid-column-end:span 6}
.small-7{grid-column-end:span 7}    .small-8{grid-column-end:span 8}
.small-9{grid-column-end:span 9}    .small-10{grid-column-end:span 10}
.small-11{grid-column-end:span 11}  .small-12{grid-column-end:span 12}

@media (min-width: 40em) {
  .medium-1{grid-column-end:span 1}   .medium-2{grid-column-end:span 2}
  .medium-3{grid-column-end:span 3}   .medium-4{grid-column-end:span 4}
  .medium-5{grid-column-end:span 5}   .medium-6{grid-column-end:span 6}
  .medium-7{grid-column-end:span 7}   .medium-8{grid-column-end:span 8}
  .medium-9{grid-column-end:span 9}   .medium-10{grid-column-end:span 10}
  .medium-11{grid-column-end:span 11} .medium-12{grid-column-end:span 12}
}

@media (min-width: 64em) {
  .large-1{grid-column-end:span 1}    .large-2{grid-column-end:span 2}
  .large-3{grid-column-end:span 3}    .large-4{grid-column-end:span 4}
  .large-5{grid-column-end:span 5}    .large-6{grid-column-end:span 6}
  .large-7{grid-column-end:span 7}    .large-8{grid-column-end:span 8}
  .large-9{grid-column-end:span 9}    .large-10{grid-column-end:span 10}
  .large-11{grid-column-end:span 11}  .large-12{grid-column-end:span 12}

  .large-offset-1{grid-column-start:2}  .large-offset-2{grid-column-start:3}
  .large-offset-3{grid-column-start:4}  .large-offset-4{grid-column-start:5}
}

/* --- top bar ------------------------------------------------------------- */
.contain-to-grid { grid-column-end: span 12; width: 100%; background: var(--tertiary); }
.contain-to-grid.radius { border-radius: var(--radius); }
.contain-to-grid.drop-shadow { box-shadow: 0 3px 6px rgba(0,0,0,.4); z-index: 1; }

.top-bar {
  display: flex;
  align-items: stretch;
  background: var(--tertiary);
  height: var(--topbar-h);
  line-height: var(--topbar-h);
  margin-bottom: 0;
  position: relative;
}
.top-bar ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; }
.top-bar .title-area { display: flex; align-items: center; }
.top-bar .name { font-family: var(--font-header); }
.top-bar .toggle-topbar { display: none; }

.top-bar-section { display: flex; flex: 1; align-items: stretch; }
/* The markup emits ul.right first and relied on float:right to place it.
   Flex respects source order, so set it explicitly instead. */
.top-bar-section ul.left  { order: 1; margin-right: auto; }
.top-bar-section ul.right { order: 2; margin-left: auto; }

.top-bar-section li:not(.has-form) > a:not(.button) {
  display: block;
  color: #fff;
  font-family: var(--font-header);
  font-size: .8125rem;
  padding: 0 .9375rem;
  height: var(--topbar-h);
  line-height: var(--topbar-h);
  background: var(--tertiary);
}
.top-bar-section li:not(.has-form) > a:not(.button):hover { background: rgba(0,0,0,.18); }

/* current section: brighter blue with the white underline Foundation drew */
.top-bar-section li.active:not(.has-form) > a:not(.button) {
  background: var(--primary);
  border-bottom: 4px solid rgba(255,255,255,.75);
}
.top-bar-section li.divider { border-left: 1px solid rgba(255,255,255,.1); }

.top-bar .button { padding: 0 calc(var(--topbar-h) / 3); line-height: var(--topbar-h); height: var(--topbar-h); }
.top-bar-section .dropdown.drop-shadow { box-shadow: 0 3px 6px rgba(0,0,0,.4); }

/* --- side nav ------------------------------------------------------------ */
.side-nav {
  /* No background: app-custom.css colours each li > a instead. Setting it on
     the container painted the whole column grey below the last item. */
  display: block;
  font-family: var(--font-header);
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-nav li a:not(.button) {
  display: block;
  color: #fff;
  margin: 0;
  padding: .4375rem .875rem;
}
.side-nav li a:not(.button):hover,
.side-nav li a:not(.button):focus { background: rgba(0,0,0,.025); color: #fff; }
.side-nav li.divider { border-top: 1px solid rgba(0,0,0,.1); height: 0; padding: 0; list-style: none; }

/* --- buttons ------------------------------------------------------------- */
/* Metrics below are Foundation's compiled values, not approximations. An
   earlier version guessed them (margin-bottom 1.25rem instead of .25rem,
   padding .8125rem/1.5rem instead of .5rem/1rem), which made every button
   oversized and pushed stacked button-groups apart. */
.button, button {
  display: inline-block;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-header);
  font-size: 1rem;
  font-weight: 400;
  line-height: normal;
  margin: 0 0 .25rem;
  padding: .5rem 1rem .5625rem 1rem;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.button:hover, button:hover, .button:focus, button:focus { background: var(--tertiary); color: #fff; }

.button.secondary, button.secondary { background: var(--secondary); color: #333; }
.button.secondary:hover, button.secondary:hover { background: #9f9f9f; color: #333; }
.button.success, button.success { background: var(--success); }
.button.success:hover, button.success:hover { background: #037a2b; }
.button.alert, button.alert { background: var(--alert); }
.button.alert:hover, button.alert:hover { background: #7d071d; }
.button.warning, button.warning { background: var(--warning); }

.button.tiny, button.tiny   { font-size: .6875rem; padding: .3125rem .625rem .375rem .625rem; }
.button.small, button.small { font-size: .8125rem; padding: .4375rem .875rem .5rem .875rem; }
.button.large, button.large { font-size: 1.25rem;  padding: .5625rem 1.125rem .625rem 1.125rem; }
.button.expand, button.expand { display: block; width: 100%; padding-left: .5rem; padding-right: .5rem; }
.button.radius, button.radius { border-radius: var(--radius); }
.button.round,  button.round  { border-radius: 1000px; }
.button[disabled], button[disabled] { opacity: .7; cursor: not-allowed; }

.button-group { display: inline-flex; margin: 0; padding: 0; list-style: none; }
.button-group > li { margin: 0; }
.button-group .button, .button-group button { margin: 0; border-radius: 0; }
.button-group > *:first-child .button,
.button-group > *:first-child button,
.button-group .button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.button-group > *:last-child .button,
.button-group > *:last-child button,
.button-group .button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.button-group .button + .button { border-left: 1px solid rgba(0,0,0,.15); }

/* Vertical variant. app-custom.css restyles the borders of .button-group.stack
   but relies on these base rules, which were missing entirely -- so the Quick
   Actions buttons on the transaction form laid out wrong. */
.button-group.stack > li { display: block; margin: 0; float: none; }
.button-group.stack > li > button,
.button-group.stack > li .button {
  display: block;
  width: 100%;
  border-left-width: 0;
  border-top: 1px solid rgba(255,255,255,.5);
  border-radius: 0;
}
.button-group.stack > li:first-child button,
.button-group.stack > li:first-child .button { border-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
.button-group.stack > li:last-child button,
.button-group.stack > li:last-child .button { border-radius: 0 0 var(--radius) var(--radius); }

/* --- panels & alerts ----------------------------------------------------- */
.panel {
  border: 1px solid var(--panel-br);
  border-radius: 0;
  margin-bottom: 1.25rem;
  padding: .9375rem;
  background: var(--panel-bg);
  color: #333;
}
.panel.radius { border-radius: var(--radius); }
.panel > :last-child { margin-bottom: 0; }

.alert-box {
  position: relative;
  display: block;
  padding: .875rem 1.5rem .875rem .875rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 0;
  background: var(--primary);
  color: #fff;
  font-size: .875rem;
}
.alert-box.radius  { border-radius: var(--radius); }
.alert-box.success { background: var(--success); }
.alert-box.alert   { background: var(--alert); }
.alert-box.warning { background: var(--warning); color: #333; }
.alert-box.secondary { background: var(--secondary); color: #333; }
.alert-box .close {
  position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  font-size: 1.625rem; line-height: 1; color: rgba(0,0,0,.6);
  opacity: .75; background: none; border: 0; cursor: pointer; padding: 0 .5rem;
}
.alert-box .close:hover { opacity: 1; }

/* --- tables -------------------------------------------------------------- */
table {
  /* No width here on purpose: Foundation lets tables size to their content.
     Forcing width:100% stretched the cashflow journal across the whole page. */
  background: #eee;
  border: solid 1px #ddd;
  table-layout: auto;
  margin-bottom: 1.25rem;
  border-collapse: collapse;
}
table thead { background: var(--table-head); }
table thead tr th, table thead tr td {
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  padding: .375rem .625rem;
}
table tfoot { background: var(--table-head); }
table tfoot tr th, table tfoot tr td { color: #fff; font-weight: 700; padding: .375rem .625rem; }
table tr th, table tr td {
  color: #222;
  font-size: .875rem;
  padding: .375rem .625rem;   /* matches Foundation; larger values made rows
                                 taller and squeezed tfoot totals onto 3 lines */
  text-align: left;
}
table tbody tr:nth-of-type(even) { background: #f9f9f9; }

/* Foundation shipped this pair, and the specificity is load-bearing:
   `table tbody tr td` (0,0,4) outranks app-custom.css's
   `table tr td { line-height: 40px }` (0,0,3), so the 40px only ever applied
   to cells outside <tbody> (tfoot totals). Dropping it made every body row
   ~22px taller. Keep it. */
table tbody tr td,
table tr td { display: table-cell; line-height: 1.125rem; }

/* --- lists --------------------------------------------------------------- */
.no-bullet { list-style: none; margin-left: 0; padding-left: 0; }
.inline-list { list-style: none; margin: 0 auto .9375rem; padding: 0; overflow: hidden; }
.inline-list > li { display: block; float: left; margin-left: 1.375rem; }

/* --- pricing tables (public pricing page) -------------------------------- */
.pricing-table { border: 1px solid #ddd; margin-left: 0; margin-bottom: 1.25rem; }
.pricing-table * { list-style: none; line-height: 1; }
.pricing-table .title {
  background: var(--table-head); color: #eee; font-family: var(--font-header);
  font-size: 1rem; font-weight: 400; padding: .9375rem 1.25rem; text-align: center;
}
.pricing-table .price {
  background: #bfbfbf; color: #333; font-size: 2rem; font-weight: 400;
  padding: .9375rem 1.25rem; text-align: center;
}
.pricing-table .description {
  background: #fff; border-bottom: 1px dotted #ddd; color: #777;
  font-size: .75rem; line-height: 1.4; padding: .9375rem; text-align: center;
}
.pricing-table .bullet-item {
  background: #fff; border-bottom: 1px dotted #ddd; color: #333;
  font-size: .875rem; padding: .9375rem; text-align: center;
}
.pricing-table .cta-button { background: #fff; padding: 1.25rem 1.25rem 0; text-align: center; }

/* --- utilities ----------------------------------------------------------- */
.left  { float: left; }
.right { float: right; }
.text-left{text-align:left} .text-right{text-align:right} .text-center{text-align:center}
.clearfix::after { content: ""; display: table; clear: both; }
.radius { border-radius: var(--radius); }

.show-for-print { display: none !important; }
@media print {
  .hide-for-print { display: none !important; }
  .show-for-print { display: block !important; }
}

.show-for-small-only { display: none !important; }
@media (max-width: 39.9375em) {
  .show-for-small-only { display: block !important; }
  .hide-for-small-only { display: none !important; }
  .left-small { float: left; }
}

/* --- modal --------------------------------------------------------------- */
/* div.reveal-modal is hidden until opened. Foundation's JS toggles it today;
   the <dialog> rules below are for the markup once it is converted. */
.reveal-modal {
  display: none;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1005;
  border: 1px solid #666;
  border-radius: var(--radius);
  background-color: #fff;
  padding: 1.875rem;
  box-shadow: 0 0 10px rgba(0,0,0,.4);
}
.reveal-modal .column, .reveal-modal .columns { min-width: 0; }

/* --- modal (native <dialog>, replacing Foundation's reveal) -------------- */
dialog.reveal-modal {
  border: 0;
  border-radius: var(--radius);
  padding: 1.875rem;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,.4);
  width: min(80%, 600px);
}
dialog.reveal-modal.tiny  { width: min(80%, 300px); }
dialog.reveal-modal.small { width: min(80%, 500px); }
dialog.reveal-modal.large { width: min(90%, 800px); }
dialog.reveal-modal::backdrop { background: rgba(0,0,0,.45); }
dialog.reveal-modal .close-reveal-modal {
  position: absolute; top: .5rem; right: 1rem;
  font-size: 1.625rem; line-height: 1; color: #aaa;
  background: none; border: 0; cursor: pointer;
}
dialog.reveal-modal .close-reveal-modal:hover { color: #666; }

/* --- forms --------------------------------------------------------------- */
/* Omitted on the first pass, which broke layout in a non-obvious way: without
   `label { display: block }` the stacked "Current Balance" / "Year-to-Date"
   labels collapsed onto one line. Values below match the compiled Foundation. */

form { margin: 0 0 1rem; }

label {
  color: #4d4d4d;
  cursor: pointer;
  display: block;
  font-size: 1rem;
  font-weight: normal;
  line-height: 1.5;
  margin-bottom: 0;
}
label.right { float: none !important; text-align: right; }

input:not([type]), input[type="text"], input[type="password"], input[type="date"],
input[type="datetime"], input[type="datetime-local"], input[type="month"],
input[type="week"], input[type="email"], input[type="number"], input[type="search"],
input[type="tel"], input[type="time"], input[type="url"], input[type="color"],
textarea {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  color: #000;
  display: block;
  font-family: var(--font-header);
  font-size: .875rem;
  height: 2.3125rem;
  margin: 0 0 1rem 0;
  padding: .5rem;
  width: 100%;
  transition: border-color .15s linear, background .15s linear;
}
input:not([type]):focus, input[type="text"]:focus, input[type="password"]:focus,
input[type="date"]:focus, input[type="email"]:focus, input[type="number"]:focus,
input[type="search"]:focus, input[type="tel"]:focus, input[type="time"]:focus,
input[type="url"]:focus, textarea:focus {
  background: #fafafa;
  border-color: #999;
  outline: none;
}
input[disabled], input[readonly], textarea[disabled], textarea[readonly],
select[disabled], select[readonly] { background-color: #ddd; cursor: default; }

textarea { height: auto; min-height: 50px; }

select {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fafafa;
  border: 1px solid #ccc;
  border-radius: 0;
  color: #000;
  font-family: var(--font-header);
  font-size: .875rem;
  line-height: normal;
  padding: .5rem;
  height: 2.3125rem;
  width: 100%;
  /* Foundation's own arrow SVG and metrics. A hand-rolled gradient arrow with
     padding-right:1.75rem was narrowing every select and truncating option
     text ("select an" instead of "select an acco..."). */
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMTJweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIzcHgiIHZpZXdCb3g9IjAgMCA2IDMiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDYgMyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gcG9pbnRzPSI1Ljk5MiwwIDIuOTkyLDMgLTAuMDA4LDAgIi8+PC9zdmc+");
  background-position: 100% center;
  background-repeat: no-repeat;
}
select:focus { background-color: #f3f3f3; border-color: #999; outline: none; }

input[type="checkbox"], input[type="radio"] { margin: 0 0 1rem 0; }
input[type="checkbox"] + label, input[type="radio"] + label {
  display: inline-block; margin-left: .5rem; margin-right: 1rem; margin-bottom: 0; vertical-align: baseline;
}
input[type="file"] { width: 100%; }

fieldset { border: 1px solid #ddd; margin: 1.125rem 0; padding: 1.25rem; }
fieldset legend { font-weight: bold; margin: 0 0 0 -.1875rem; padding: 0 .375rem; }

/* Foundation tightened nested rows inside forms; keep the same gutters. */
form .row .row { margin: 0 -.5rem; }

/* --- Foundation JS bridge ------------------------------------------------ */
/* Foundation 5's JavaScript reads its breakpoints back out of the stylesheet by
   inspecting the computed font-family of these <meta> elements. With the rules
   absent, $(document).foundation() throws and every statement after it in
   app.js stops running -- which is why the transaction Totals row rendered
   blank: AutoSum() at app.js:265 never executed.
   Required only while foundation.min.js is still loaded; remove it together
   with Foundation's JS once the modal is converted to native <dialog>. */
meta.foundation-version { font-family: "/5.5.3/"; }
meta.foundation-mq-small { font-family: "/only screen/"; width: 0; }
meta.foundation-mq-small-only { font-family: "/only screen and (max-width: 40em)/"; width: 0; }
meta.foundation-mq-medium { font-family: "/only screen and (min-width:40.0625em)/"; width: 40.0625em; }
meta.foundation-mq-medium-only { font-family: "/only screen and (min-width:40.0625em) and (max-width:64em)/"; width: 40.0625em; }
meta.foundation-mq-large { font-family: "/only screen and (min-width:64.0625em)/"; width: 64.0625em; }
meta.foundation-mq-large-only { font-family: "/only screen and (min-width:64.0625em) and (max-width:90em)/"; width: 64.0625em; }
meta.foundation-mq-xlarge { font-family: "/only screen and (min-width:90.0625em)/"; width: 90.0625em; }
meta.foundation-mq-xlarge-only { font-family: "/only screen and (min-width:90.0625em) and (max-width:120em)/"; width: 90.0625em; }
meta.foundation-mq-xxlarge { font-family: "/only screen and (min-width:120.0625em)/"; width: 120.0625em; }
meta.foundation-data-attribute-namespace { font-family: false; }
meta.foundation-mq-topbar { font-family: "/only screen and (min-width:40.0625em)/"; width: 40.0625em; }